focus problem
I have a fairly simple problem that i can't figure out. I have a page that has 4 buttons and when you click one it opens the options behind each button. I can't figure out how to set the focus to the text field behind the buttons when they are pressed. For instance, I have one button that says "Search by phone number" so when you click on it it has a dropdown where you can enter a phone number. I want to know how to set the focus to that textbox so they don't have to click in the box first.
Referencing/Selecting Dynamic DOM
Hi guys, not sure if my subject is completely correct, but basically here's my problem. I'm passing in HTML code and dynamic data from a database, from a model, through an Ajax call, to a single DIV in my view. Example from the model: $loadModuleStr = ''; $loadAdminStr .= '<td><a href="#" id="updatePrivs" set="No" user="' . $users[0] . '" module="' . $users[1] . '">Yes</a></td>'; $loadAdmin['loadUsers'] = $loadAdminStr; Example from the ajax call: $("#importedUsers").html(json.loadUsers); And the
Hi Got a problem about adding a number
I got this code : // toggle disable enable add subtotal function function calculateSumDisabled(sourceCalc , targetCalc) { //var sumTotal = 0; var sumTotal = parseFloat(targetCalc.html()); if ($(sourceCalc).attr('disabled') === true) { sumTotal = (sumTotal - sourceCalc.val()) ; } else { // sumTotal = (sumTotal + sourceCalc.val()) ; } $(targetCalc).html(sumTotal); } and while subtracting the value working
Call to fadeIn() within a loop causing page to scroll up
Hi, I am using a timer to fadeOut and fadeIn some articles such that 5 articles are displayed in rotation. However, for some reason the call to fadeIn or fadeOut is causing the page to change it's y scroll position. If I am currently at the bottom of the page, the fadeIn call causes the page to scroll up. Is there anything obvious that I am missing? Thanks, Farhad
controlling display order of components
Hi, I am having the classic problem of visual elements loading in an order that is not optimal. For example, foreground elements have masks which blend them to the background but without the background they look unattractive. Problem is that the background is the largest file by far and so there is usually a 1-2 second weirdness phase. I would love to hear from anyone who has implemented a solution using jQuery for controlling the order of element display. I imagine it has to de done before document
Quest regarding ajax jquery design
Hi, I am having trouble figuring the best was to design a piece of ajax functionality. I have a php page with a list of users. Each row has an actions button, when the button is clicked it calls the server to get the state and creates a row of links (follow and activate for instance). If you click on a link labeled activate it makes an ajax call to change the state of the user's activate field. The button should now be replaced with a deactivate activate button. I have figured out a few ways to do
[jQuery validation]: unable to submit form: 1 required input type field and multiple hidden input type fields.
Hi, I'm attempting to validate one form 'input type' field using jquery, but in this form are multiple other hidden 'input type' fields that need to be submitted with the validated field. My problem is that my submit button isn't submitting, but the validation is working on the single field. It seems that it's trying to validate the hidden fields, and maybe my submit method is incorrect. I've tried using ignore: ":hidden" inside the rules: { }, but it doesn't seem to do the trick. This is my code:
Problem preventing form submission
I have a very simple script that checks to see if any fields with the class of 'require' are empty. If any of them are, then I want the script to prevent form submission. Here is what I currently have: // prevent form submission if required fields are empty $(document).ready(function() { $('#frm-contact').submit(function() { if ($('#frm-contact .require').val() == '') { alert('Please make sure that all of the fields marked with a * are filled in.'); return false;
JQuery.ajax and asp.net
Hey guys, I'm fairly new to jquery, currently using it for an assignment and I'm asking if maybe anyone came across a solution to the following problem. I am experiencing a delay when calling an asp.net webserivce that is displaying the output on the web page as "undefined". The job of the web service is to call a method to get a particular value from MySQL. The value that I want is being returned because when I use alert(response.d), the value shows up. but when I do: $.ajax({ type: "POST",
Redirect page
My problem now is that I am programming a login module and what I need is that when the login and password be wrong to show an error message on a <div>, but when the login and password be right open a new page without loading it on a <div>.
Firefox $.get problem
Hi guys, I have the following simple jquery code $('#views-exposed-form-Filtering-page-1').attr('action', '#').submit( function(e){ alert('working'); $.get('http://www.mysite/my_ajax.php', function(xml){ alert('retrieved : '+xml); }); e.preventDefault(); } ); All I am doing is overriding the action attribute of a form and when the form is submitted, instead of the default action, I want
Reading data from array
I am attempting to read XML information from a remote source into a javascript array. Upon retrieveing the XML, I load it into array by sections. I am doing this with the following code: $(theXML).find('person').each( function($i){ $data.push({ firstname: $('name', this).text(), lastname: $('lastname', this).text() }); } );My problem is I am attempting to list each of
Why .ajaxError and friends are not static functions of jQuery?
I don't get why .ajaxError and friends which are basically custom events are coupled with dom elements. // why should i bind to document, if i don't need it $(document).ajaxError(function() { reportError() }especially given that reporting to dom would be still easy the other way around $.ajaxError(function(){ $(".msg").html("ajax error") }Anyone can explain? Thanks, Federico
How to edit node in xmlHttpObject
I'm putting together an online xml editor using jquery for the interface and a php back-end. I have the php script send a snippet via ajax() to the web-page as an xmlHttpObject. This xml data is presented in editable form fields using jquery. What I'm having trouble with is taking the data from one of those form fields (textareas) and using it to change a particular node in the xmlHttpObject before sending that back to the php script. Any suggestions? Can I manipulate the xmlHttpObject or do I need
using .append to build a complex menu
To build a menu block which should be switchable with hide/unhide of the menu items, I'm using .append html. The code idea is this: navigat += '<h3 class="infoH3"> <a id="' + menuID +'"' + ' href="javascript:slideMenu(\'' + menuSlider + '\');">' + menuName + '</a></h3>'; navigat += '<div id="' + menuSlider + '" style="display:none">'; navigat += '
jQuery forcing tables to go wide and plugin to vanish.
I'm working on a client's site and I decided to use a slider ... http://assault.toceffect.com it can be seen there as I develop it. Here's the problem: If you refresh the page enough times, the table that contains the slider will go SUPER wide, it will go 2400px wide in fact. 2400px is the combined width of all my images. When I followed the tutorial here on jQuery.com that value was originally set to 99999px ... you can imagine that before I changed that value, the table forced the page out to
fade in/out dynamic messges
hi,I am trying to fadeIn error message received from the server. Here is the code: $("#" + RowID + "> TD:nth-child(4)").append("<err class='error'>" + err.Message + "</err>").fadeIn(1000); But the fadeIn() does not seem to work, it shows the message straight away .. off course I am missing something here, probably the append() and fadeIn() do not go hand in hand. Thanks in advance for the help.
Show/Hide Div in Table in IE
I don't know if I'm the only person who ever has this issue, but it is getting on my nerves...and I've finally found a solution, though would appreciate input on a simpler one. Note that these issues are specific to IE8, and I am using for the purpose of creating a program which works in IE, FF, Chrome, so I've only tested my solutions in those 3. I wasn't sure whether to start this as a question (as I am asking for an easier solution) or if I note it as a problem or discussion. Any time I've used
jquery ajax download
hi there, i am trying to pop up a download dialog after a link is clicked using jquery, i have tried this code but the download dialog is not popping up var options = { type: "GET", url: "FileHandler.ashx?download=1&filename=" + filename, data: "{filename:'" + filename + "'}", success: function(msg) { alert('success'); }, error: function(response) { alert('error'); }};
Change an Image after a Success AJAX Call
Hi, I've a list of items and an image displaying if the item it's available or not. I already have a link on the image and a script that switch status of the record, all this using AJAX. However I want to switch the image after success of AJAX request. So my code for AJAX: $('table#lista-boleias td#status a.switch').click(function(){ var actImg = $(this).find('img').attr('id'); var image = $(this).find('img'); $(this).html('<img src="_assets/process.gif" id="loadwait" alt="Loading..."/>').fadeIn("slow");
"Skewed" image slider in jquery?
Hi, I have a client that wants to emulate a slider as found on this page: http://www.gardenia.it/en/serie.php I was wondering if this is possible to recreate in jquery? And also if there is an existing script already available for download that would do this??
fadeIn() and scale() at the same time?
i have this, which is of course wrong $('#myholder').fadeIn().show('scale', { percent: 100 }, 500); how can i code a function for fadeIn and scale at the same time for an element? thanks for any help
JSONP and time-outs
Hi I'm using $.ajax and dataType jsonp which works by registering a callback and 'injecting' a script block. This does not appear to pay any attention to the timeout setting. (With 'normal' Ajax the error callback would fire if the timeout was exceeded). This appears to be a known problem and is being treated as an enhancement by the jQuery team: (?#3442). In the meantime. If I leave my app running making jsonp calls on a setInterval and each one just doesn't respond (not 404 - just doesn't respond)
Using jaquery to update a form from a partial view?
I am fairly new to Jquery. I am using ajaxform to submit a form for validation. The form is validated and returned. The code works in firefox and chrome all the time but only the first time in IE. Is there a workaround or solution? function bindForm() { var options = { target: '#myForm', // target element(s) to be updated with server response success: showResponse // post-submit callback }; // bind form using 'ajaxForm' $('#CreateCultureForm').ajaxForm(options); } function showResponse(responseText,
Hover checkbox
Hello, me script is: $(\"li input\").hide(); $(\".obrli\").hover( function () { $(\"li input\").show(); }, function () { if ($(\"li input\").is(\":checked\")) { //show the hidden div $(\"li input\").show(); }else{ $(\"li input\").hide(); } } ); and html: <li id="pozice_94" class="obrli"> <p class="image"> <img src="image.jpg" /> <input type="checkbox" type="checkbox" id="checkboxli" name="now[]" value="94" /> <a href="#" class="image-edit">upravit</a> </p> </li> When the image moves
pass variables in functions
Hi I have this code, but I want to put it in functions and I don't know how to pass the variables. This is the code: [code] <script type="text/javascript"> <!-- $(document).ready(function () { // Username validation logic var validateUsername = $('#validateUsername'); var validateTitle = $('#validateTitle'); $('#naam').focus(function() { $(this).addClass('with-box'); validateUsername.css('display','block');
Jquery script making a page JUMP!
Hi - i have designed a page that uses a jquery script in a div in the middle of the page (below the logo and upper nav) Every time I click on a button that is part of the script, the page jumps down to the top of that jquery div. I want the page to stay rooted to the top. I can't tell whether this is a problem with the css or the js script. Any help would be greatly appreciated!! -Lisa ~ page: http://www.supermarketsmarty.com/new/index22.html ~ page css: http://www.supermarketsmarty.com/new/css/global.css
IE is messing up my slide
Go here: http://cyrusandjennyusa.com/services.html and click on any of the pics at the bottom. On the next page, the small pics slide in from right in all the Real browsers. In IE they pop in at left, make the page jump, then slide in from right - really ugly effect. Any way to fix this? ( Gnashing of teeth and cursing IE as per usual, which is also messing up my dropdown menu, but that's another story )
jQuery + Foursquare API, returns me a "null" Object from JSON
Hello folks!! (excuse my english if I'm wrong) I use the advantage of JSON by the capability to be Crossdomain, I tried several times to parse and get data from the Foursquare's API, but, at time when I try to show data, the script simply does nothing, and, with some alerts, I figured out that the trouble appears at the moment to get the '"json" result, the reason: give's me a NULL, I mean, brings nothing with it. BTW I have to do it only with javascript, for this, I use JQuery to get it better
Find, Manipulate Object/Embed
I'm trying to figure out if/how I could use jquery to select and manipulate an <object> or <embed> that don't have assigned classes, ids, or rel tags. Basically, I want to find an embedded video and do something with it. Thanks!
value of "selected" option returns "undefined" under jQuery 1.4.2
This routine used to work when I was using jQuery 1.3.2. Now that I've switched to 1.4.2 it fails. I've verified that returning to 1.3.2 fixes the problem. I have a page which includes this select pulldown: <select name="template" id="template_pulldown"> <option value="emerald" selected="selected">Emerald</option> <option value="classic">Classic</option> <option value="terminal">Terminal</option> <option value="quidditch">Quidditch</option> <option value="fruity">Fruity</option> <option value="fourthjuly">Fourth
Drag and Throw
Hi, This may have been asked before, I'm not sure. Basically, I was wondering whether there are any existing jquery plugins or code that does a drag and throw function. There are absolutely loads of flash/actionscript versions, but as far as I can see, no Jquery or javascript solutions. An example of what I mean: http://www.theorigin.net/tutorialFiles/HockeyPuck/hockeypuck.swf Thanks, Dan
Looping through a table and injecting google maps markers
First off, I am working with Drupal. I am new to jQuery and have used it for a few things on my site so far, but none has been as complicated as what I'm trying to do now. I am working on a website for a client that has a locator for all Federally Licensed Firearms dealers in the US. I have about 31,000 entries in my database. I have a proximity search that works well, you simply enter a zipcode and your nearby results populate in a table and a google map shows markers that correlate with the results.
notification using ajax call
Hello, After the load of ajax call from a server on a different domain, if the call completes, I'd like to send a notification to the backend server (sitting on a different domain) to notify it that the call is completed and the server could log this call as success. The javascript code sending out this notification does not need any response from the backend. So there is no need for a callback. Could this be done by an ajax call to send notification to a server in a different server? Could I set
$.get() in different browsers
Got a problem with the $.get() function on my site.. $('.tunchecked').click(function(e) { id = this.id; e.preventDefault(); $.get("/task/finishTask/"+id); location.reload(true); }); .tunchecked is a checkbox that should call a php function called finishtask . the reload and preventdefault works but not the actual calling of the function.. it works in IE (8), Opera (10.5) but not in Chrome, Firefox(latest) or Safari. Does anybody know why this is?
Problems with +/& characters when sending ajax requests.
Hi All, I am trying to build a PDF printing solution for my site, currently I have a small icon that a user clicks to print a pdf, then jquery reads the <DIV> content html and send it to PHP via ajax, but I have these problems: + characters are dropped. & character breaks the content that is being sent via ajax, it seems like as soon as jquery finds the & character, it tries to split that into another parameter. Any ideas on how to resolve this? I have tried to get the content like this: var content
How do I remove queue request from animated callback function
I modified a step carousel slider so that I could have multiple sliders on the same page/post in Wordpress. I ran into a contention issue where one slider would freeze up while the other kept sliding. The animation calls use callbacks that are also animation calls so that complicated it a bit. At first I thought I would need to create a javascript semaphore to solve the problem. I have only been using jQuery for a couple of days and found the .queue command and that seemed to solve the problem. My
Animating sliding panels, problems
Hello, I’m trying to create sliding panel similar to this one (http://cherne.net/brian/resources/jquery.slidingPanels.html) but I’m having problems with animating them. Every time I hover over one of the panels, widths of other panels get messed up, and sometimes panels even disappear (probably because of queued animations). I’ve provided code with panels and panel opening/closing without animation which works but I’m hoping anyone here can provide solution for properly animating panels. Thanks in
JQuery Menu Help
Hi guys. Can someone please help me with my Jquery menu? I have managed to do the 1st level (accordion type)... my only problem is how to implement the vertical style drop down (the black one) and to make it flexible (e.g. adding more sub menus)..
Menu like cbs.com?
Hi, I'm new to jQuery. I wonder if it's possible to implement a menu like the one of cbs.com? Basically, when mouse over some of the menu items, a menu panel shows up with a few columns of links. The many panel disappears when the mouse moves out. I think it's quite neat and I'm hoping to be able to do something like that with jQuery. Any help/hint is appreciated!
Next Page