Search Results

Search found 17577 results on 704 pages for 'jquery tooltip'.

Page 54/704 | < Previous Page | 50 51 52 53 54 55 56 57 58 59 60 61  | Next Page >

  • jQuery: Targeting elements added via *non-jQuery* AJAX before any Javascript events fire? Beyond th

    - by peteorpeter
    Working on a Wicket application that adds markup to the DOM after onLoad via Wicket's built-in AJAX for an auto-complete widget. We have an IE6 glitch that means I need to reposition the markup coming in, and I am trying to avoid tampering with the Wicket javascript... blah blah blah... here's what I'm trying to do: New markup arrives in the DOM (I don't have access to a callback) Somehow I know this, so I fire my code. I tried this, hoping the new tags would trigger onLoad events: $("selectorForNewMarkup").live("onLoad", function(){ //using jQuery 1.4.1 //my code }); ...but have become educated that onLoad only fires on the initial page load. Is there another event fired when elements are added to the DOM? Or another way to sense changes to the DOM? Everything I've bumped into on similar issues with new markup additions, they have access to the callback function on .load() or similar, or they have a real javascript event to work with and live() works perfectly. Is this a pipe dream?

    Read the article

  • jQuery ajax form submit - how to ensure dynamically loaded form's action is used

    - by kenny99
    Hi, i'm having a problem with dynamically loaded forms - instead of using the action attribute of the newly loaded form, my jquery code is still using the action attribute of the first form loaded. I have the following code: //generic ajax form handler - calls next page load on success $('input.next:not(#eligibility)').live("click", function(){ $(".form_container form").validationEngine({ ajaxSubmit: true, ajaxSubmitFile: $(this).attr('action'), success : function() { var url = $('input.next').attr('rel'); ajaxFormStage(url); }, failure : function() { } }); }); But when the next form is loaded, the above code does not pick up the new action attribute. I have tried adding the above code to my callback on successful ajax load (shown below), but this doesn't make any difference. Can anyone help? Many thanks function ajaxFormStage(url) { var $data = $('#main_body #content'); $.validationEngine.closePrompt('body'); //close any validation messages $data.fadeOut('fast', function(){ $data.load(url, function(){ $data.animate({ opacity: 'show' }, 'fast'); '); //generic ajax form handler - calls next page load on success $('input.next:not(#eligibility)').live("click", function(){ $(".form_container form").validationEngine({ ajaxSubmit: true, ajaxSubmitFile: $(this).attr('action'), success : function() { var url = $('input.next').attr('rel'); ajaxFormStage(url); }, failure : function() { } }); }); }); });

    Read the article

  • HOWTO: implement a jQuery version of ASP.Net MVC "Strongly Typed Partial Views"

    - by Sam Carleton
    I am working on a multi-page assessment form where the questions/responses are database driven. Currently I the basic system working with Html.BeginForm via standard ASP.Net MVC. At this point in time, the key to the whole system is the 'Strongly Typed Partial Views'. When the question/response is read from the database, the response type determines which derived model is created and added to the collection. The main view it iterates through the collection and uses the 'Strongly Typed Partial Views' system of ASP.Net MVC to determine which view to render the correct type of response (radio button, drop down, or text box). I would like to change this process from a Html.BeginForm to Ajax.BeginForm. The problem is I don't have a clue as to how to implement the dynamic creation of the question/response in the JavaScript/jQuery world. Any thoughts and/or suggestions? Here is the current code to generate the dynamic form: @using (Html.BeginForm(new { mdsId = @Model.MdsId, sectionId = @Model.SectionId })) { <div class="SectionTitle"> <span>Section @Model.SectionName - @Model.SectionDescription</span> <span style="float: right">@Html.CheckBoxFor(x => x.ShowUnansweredQuestions) Show only unaswered questions</span> </div> @Html.HiddenFor(x => x.PrevSectionId) @Html.HiddenFor(x => x.NextSectionId) for (var i = 0; i < Model.answers.Count(); i++) { @Html.EditorFor(m => m.answers[i]); } }

    Read the article

  • Having trouble parsing XML with jQuery

    - by Jack
    Hi Guys, I'm trying to parse some XML data using jQuery, and as it stands I have extracted the 'ID' attribute of the required nodes and stored them in an array, and now I want to run a loop for each array member and eventually grab more attributes from the notes specific to each ID. The problem currently is that once I get to the 'for' loop, it isn't looping, and I think I may have written the xml path data incorrectly. It runs once and I recieve the 'alert(arrayIds.length);' only once, and it only loops the correct amount of times if I remove the subsequent xml path code. Here is my function: var arrayIds = new Array(); $(document).ready(function(){ $.ajax({ type: "GET", url: "question.xml", dataType: "xml", success: function(xml) { $(xml).find("C").each(function(){ $("#attr2").append($(this).attr('ID') + "<br />"); arrayIds.push($(this).attr('ID')); }); for (i=0; i<arrayIds.length; i++) { alert(arrayIds.length); $(xml).find("C[ID='arrayIds[i]']").(function(){ // pass values alert('test'); }); } } }); }); Any ideas?

    Read the article

  • jQuery Validation plugin: disable validation for specified submit buttons when there is submitHandle

    - by ccppjava
    Ok, I am using umbraco forum module, and on the comment form it uses jquery validate plugin. The problem is that I have added a search button on the same page using a UserControl, the search submit button triggers the comment form submission validation. I have done some research, and added the 'cancel' css class to the button. This bypass the first validation issue, however, it still fall into the 'submitHandler'. Have read the source code and find a way to detect whether the search button triggers the submission. however, there is not a nice way to bypass the handler. I am currently using a ugly way to do it: create javascript errors! I would like to know a nicer way to do the job. Many thanks! Btw, I am currently using: submitHandler: function (form) { $(form).find(':hidden').each(function () { var name = $(this).attr('name'); if (name && name.indexOf('btnSearch') === name.length - 'btnSearch'.length) { // this is a dirty hack to avoid the validate plugin to work for the button eval("var error = 1 2 ''"); } }); // original code from umbraco ignored here.... } ...............

    Read the article

  • mvc jquery passing form values after user presses "Accept" button

    - by gdubs
    So I have a form and a submit button that posts the form to an action. But I wanted to show a popup where the user can deny or accept an agreement. Here's my jquery $(document).ready((function () { var dialog = $('#confirmation-dialog').dialog({ autoOpen: false, width: 500, height: 600, resizable: false, modal: true, buttons: { "Accept": function () { $(this).dialog('close'); $.ajax({ type: 'POST', data: {__RequestVerificationToken: $("input[name=__RequestVerificationToken]").val()} }); }, "Cancel": function () { $(this).dialog('close'); } } }); $('#registration-submit').click(function (e) { var action = $(this.form); console.log(action); var form = $('form'); dialog.dialog("open"); return false; }); })); My problem with this is that it would post, but it would only send my AntiforgeryToken, and not the values of the form. But when it goes through the TryupdateModel it would go through for some reason but will not Save (cuz of the missing data that wasn't passed on the formcollection).

    Read the article

  • Jquery hide is not working in my Dialog box close span

    - by kumar
    $('.ui-dialog-titlebar-close ui-corner-all').hide(); this is the hide for my Jquery dialog close 'X' span.. this is not working in my case. I am trying to hide that Close becuase its not showing me in my dialog when I resize my dialog then its showing me.. some reason my CSS not showing me that Close button correctly on my POPUP. Can any body help me out. here is my code and CSS. $("#window").dialog({ resizable: true, height: 180, title: titles, width: 500, modal: true, open: function () { $('.ui-widget-overlay').show(); $('.ui-dialog-titlebar-close ui-corner-all').hide(); }, buttons: { "OK": function () { $(this).dialog("close"); if (redirectURL) { window.location = redirectURL; } } } }); here is my CSS. <style> .ui-widget-overlay { background: black; opacity: 0.5; filter: alpha(opacity = 50); position: absolute; top: 0; left: 10; } </style> Can any body tell me how to show My Close 'X' correctly on my dialog or I need to hide that Close 'X' thanks

    Read the article

  • Ruby on Rails + Jquery: Saving data from draggable lists

    - by sjsc
    Hello. I'm trying to save data to the MySQL database in Rails when the user drags items from different lists. I'm using the below Jquery script and HTML: <script> $(document).ready(function() { $("#draggable").draggable( { connectToSortable: 'ul#myList', helper:'clone' } ); $("#myList").sortable(); }); </script> HTML: <ul> <li id="draggable">Drag me to myList</li> </ul> <ul id="myList"> <li id="item-1">item 1</li> <li id="item-2">item 2</li> </ul> I know I probably have to use something like this: $.post({ url: 'lists/update', data: $('#myList').sortable("serialize") }); I've been Googling for the last few hours but can't seem to find how to save data between multiple lists using Rails. Any idea?

    Read the article

  • jquery can't get the change event on select element

    - by user63898
    i have this code the jquery code never got triggered none of the scripts are triggered : $('select[name=privileges]').change(function(){ alert("id"); var id = $(this).find(':selected')[0].id; alert(id); $('#changevalue').val(id); }) or this: $("#privileges_select").change(function() { alert($('#privileges_select option:selected').html()); }); <form method="GET" action="create_new_user.php"> user:<input type="text" size="40" name="user_name"/> password:<input type="text" size="40" name="password"/> <select name=privileges id="privileges_select"> <option name='opt_1'>admin</option> <option name='opt_2'>ordinary</option> </select> <input type="hidden" name="item_options_id" value="" id="changevalue" /> <input type="submit" value ="create" /> <input type="reset" /> </form> in the end i like to send the selected option id in the form get

    Read the article

  • jquery form validation, and submit-on-change

    - by Bee
    I want to make all my settings forms across my site confirm that changes are saved, kinda like facebook does if you make changes in a form and then try to navigate away without saving. So I'm disabling the submit button on the forms only enabling if the values change. I then prompt the user to hit save before they leave the page in the case that they do have changes pending. var form = $('form.edit'); if(form.length > 0) { var orig_str = form.serialize(); $(':submit',form).attr('disabled','disabled'); form.on('change keyup', function(){ if(form.serialize() == orig_str) { setConfirmUnload(false); $(':submit',form).attr('disabled','disabled'); } else { setConfirmUnload(true); $(':submit',form).removeAttr('disabled') } }); $('input[type=submit]').click(function(){ setConfirmUnload(false); }); } function setConfirmUnload(on) { window.onbeforeunload = (on) ? unloadMessage : null; } function unloadMessage() { return 'If you navigate away from this page without saving your changes, they will be lost.'; } One of these forms needs some additional validation which I do using jQuery.validate library. e.g. if i wanted to ensure the user can't double submit the form on accident by double clicking on submit or somesuch (the actual validation in question is for a credit-card form and not this simple): $('form').validate({ submitHandler: function(form) { $(':submit', form).attr('disabled','disabled'); form.submit(); } }); Unfortunately both bits are trying to bind to submit button and they're interfering with each other such that the submit button remains disabled no matter what I do and it is impossible to submit the form at all. Is there some way to chain the validations together or something? Or some other way to avoid re-writing the validation code to repeat the "did you change anything in the form" business?

    Read the article

  • Determining selected state of jQuery Buttons

    - by lloydphillips
    I've got two radio buttons in a .net page which are being transformed to jQuery buttons a la http://jqueryui.com/demos/button/#radio When the page is loaded I have button 2 as checked. When clicking the buttons I'm firing the postback event. Problem is you can click on that button that is selected by default on the initial load i.e. Button 2, the postback is fired but the event handler isn't called in the .net code behind because the radio button is already classed as selected (and in normal circumstances wouldn't allow the postback to fire). To get around this I've added the e.PreventDefault() method BUT this is causing issues when Button 1 is clicked because before the click handler is called the button is set to selected. Therefore, in every case in the following code e.PreventDefault() is called: $(document).ready(function(){ $("[id*='rbPayable']").click(function(e){ if ($("[id*='rbPayable']").attr("checked")) e.preventDefault(); else setTimeout('__doPostBack(\'this.id\',\'\')', 0) }) $("[id*='rbReceivable']").click(function(e){ if ($("[id*='rbReceivable']").attr("checked")) e.preventDefault(); else setTimeout('__doPostBack(\'this.id\',\'\')', 0) }) }); What is the best way for me to load the page and effectively be able to do the following: 'If rbReceivable is checked then don't do anything otherwise do a postback.'

    Read the article

  • How to test jQuery Ajax with php?

    - by vladv
    I tried to just send some information to a php file using Jquery Ajax. I wanted to send some info to the php file every time a click is made. <script> $(document).ready(function() { $('#checkbox').click(function() { $.ajax({type : "POST", url : "test.php", data : "ffs=somedata&ffs2=somedata2", succes : function() { alert("something"); } }); }); }); </script> <body> <input type = "checkbox" name = "checkbox" id = "checkbox"> </body> The php file looks like this: <?php echo $_POST['ffs']; ?> Now, I see the POST going, (using firebug). I get no errors, but nothing happens in the php file. Also success is never reached, so no alert is triggered. What should I do in the php file so that I can trigger success and also see the sent info?

    Read the article

  • jQuery ajax only works first time

    - by Michael Itzoe
    I have a table of data that on a button click certain values are saved to the database, while other values are retrieved. I need the process to be continuous, but I can only get it to work the first time. At first I was using .ajax() and .replaceWith() to rewrite the entire table, but because this overwrites the DOM it was losing events associated with the table. I cannot use .live() because I'm using stopPropagation() and .live() doesn't support it due to event bubbling. I was able to essentially re-bind the click event onto the table within the .ajax() callback, but a second call to the button click event did nothing. I changed the code to use .get() for the ajax and .html() to put the results in the table (the server-side code now returns the complete table sans the <table> tags). I no longer have to rebind the click event to the table, but subsequent clicks to the button still do nothing. Finally, I changed it to .load(), but with the same (non-) results. By "do nothing" I mean while the ajax call is returning the new HTML as expected, it's not being applied to the table. I'm sure it has something to do with altering the DOM, but I thought since I'm only overwriting the table contents and not the table object itself, it should work. Obviously I'm missing something; what is it? Edit: HTML: <table id="table1" class="mytable"> <tr> <td><span id="item1" class="myitem"></span> <td><span id="item2" class="myitem"></span> </tr> </table> <input id="Button1" type="button" value="Submit" /> jQuery: $( "Button1" ).click( function() { $( "table1" ).load( "data.aspx", function( data ) { //... } ); } );

    Read the article

  • jQuery - Compatibility Problem with Internet Explorer 7 and Opera

    - by Marius
    Hello there, I have this counter which counts + 1 every time somebody shares content from the site. When it happens, the social icon that was clicked will bounce. It works in Firefox,Chrome, IE8, and Opera, however the bouncing animation is wrong in opera. $.fn.countExternal = function(animSpeed, num) { // for each counter this.each(function(){ // select all the digit containers var span = $(this).children(); // count the num of digit containers var len = $(span).length; // get the current count u = $(span).text(); // copy variable and add increment(s) v = num + ''; // foreach digit container... for (i=v.length - 1; i >= 0; i--) { // ...check which digits are not affected by the increment(s) if (v.charAt(i) == u.charAt(i)) { break; } } // slice from the total number of digit containers the digits containers which needs updating. slce = len - (v.length - (i + 1)) var updates = $(span).slice(slce); // loop through each digit container and fade out ... $(updates).fadeTo(animSpeed, 0,function(){ $(updates).each(function(index){ f = i + 1 + index; // ...then pick the right digit and update the digit... $(this).text(v.charAt(f)); // ...before fading back in. Cycle complete. $(this).fadeTo(animSpeed, 1); }); }); }); }; }) (jQuery); Demo (NSFW) is here (look underneath the social sharing icons). Any idea how I can solve the IE, and possibly the Opera compatibility problem? Thank you for your time.

    Read the article

  • Jquery animate negative top and back to 0 - starts messing up after 3rd click

    - by Daniel Takyi
    The site in question is this one: http://www.pickmixmagazine.com/wordpress/ When you click on one of the posts (any of the boxes) an iframe will slide down from the top with the content in it. Once the "Home" button in the top left hand corner of the iframe is clicked, the iframe slides back up. This works perfectly the first 2 times, on the 3rd click on of a post, the content will slide down, but when the home button is clicked, the content slides back up normally but once it has slid all the way up to the position it should be in, the iframe drops straight back down to where it was before the home button was clicked, I click it again and then it works. Here is the code I've used for both sliding up and sliding down functions: /* slide down function */ var $div = $('iframe.primary'); var height = $div.height(); var width = parseInt($div.width()); $div.css({ height : height }); $div.css('top', -($div.width())); $('.post').click(function () { $('iframe.primary').load(function(){ $div.animate({ top: 0 }, { duration: 1000 }); }) return false; }); /* slide Up function */ var elm = parent.document.getElementsByTagName('iframe')[0]; var jelm = $(elm);//convert to jQuery Element var htmlElm = jelm[0];//convert to HTML Element $('.homebtn').click(function(){ $(elm).animate({ top: -height }, { duration: 1000 }); return false; })

    Read the article

  • IE8 ignores jQuery UI 'dialog' minHeight and height settings

    - by Kev
    I'm using jQuery 1.4.4 with jQueryUI 1.8.7 to display a modal dialog box. I'm having a problem where IE8 renders a scrollbar and appears to ignore the minHeight and height options in all the many different combinations I've tried them in. In Chrome 8 and Firefox 3.6 my dialogue looks like: In IE 8 it looks like: The markup and script looks like: <a id="create" href="#">Create New Thing</a> <div id="dlg-create-thing" title="Create new thing?"> <form name="create-thing-form" id="dlg-create-thing-form"> <p style="text-align:left"> <span>Name: <input id="thingName" name="thingName" maxlength="12" size="30" /></span> <br /><br /> <b>Thing options:</b><br /><br /> <input type="radio" id="option1" name="theoptions" value="0" checked="checked" />Use this option<br /> <input type="radio" id="option1AndMem" name="theoptions" value="1" />Use this other option </p> </form> </div> <script type="text/javascript"> $(function () { $("#dlg-create-thing").dialog({ autoOpen: false, resizable: false, width: 500, modal: true, minHeight: 280, buttons: { "Create": function () { /* do stuff */ }, "Cancel": function () { /* do other stuff */} } }); $("body").delegate("a[id='create']", "click", function () { $("#dlg-create-thing").dialog('open'); return false; } ); }); </script> How can I fix this (preferably in a nice browser agnostic way, but I'd settle for anything)?

    Read the article

  • Tiny MCE (jquery plugin version) not showing toolbar in IE (works fine in other browsers)

    - by I am Wonder
    I had an implementation working well but for some reason IE decided it was tired of playing nice. I have an advanced implementation of TinyMCE (the jquery plugin version - see http://tinymce.moxiecode.com/examples/example_23.php for details). It still works great in all browsers but IE. In IE it shows the drop-down options for Format, Font family, and Font size, but only as text.. not as a drop down normally looks. All other buttons on the toolbar are missing. (I've tried IE8 and IE8 Compatibility Mode) I get a javascript error: Syntax error Line 36 Char 1. Unfortunately the javascript is being loaded dynamically so this doesn't help me. Here is my implementation code for the TinyMCE editor: $(function () { $('#InputStuffHere').tinymce({ // General options theme: "advanced", plugins: "safari,pagebreak,style,layer,table,save,advhr,advimage,advlink,inlinepopups,preview,media,searchreplace,contextmenu,paste,fullscreen,noneditable,visualchars,nonbreaking,template", // Theme options theme_advanced_buttons1: "bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,formatselect,fontselect,fontsizeselect,|,hr,removeformat", theme_advanced_buttons2: "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,image,|,forecolor,backcolor,|,spellchecker", theme_advanced_buttons3 : "", theme_advanced_toolbar_location: "top", theme_advanced_toolbar_align: "left", theme_advanced_statusbar_location: "bottom", theme_advanced_resizing: true, // Drop lists for link/image/media/template dialogs template_external_list_url: "lists/template_list.js", external_link_list_url: "lists/link_list.js", external_image_list_url: "lists/image_list.js", media_external_list_url: "lists/media_list.js", //initialization callback init_instance_callback: "TinyMCEReady", add_form_submit_trigger : false }); }); So... anyone seen anything like this or have any ideas for me? Thank you so much everyone!

    Read the article

  • jQuery validation plugin - no error messages instead custom backgrounds

    - by Skoota
    I am using the jQuery validation plugin. The form which is being validated has custom background images for the text input fields, so instead of showing an error message for invalid fields I would like to change the background image. Making things a bit trickier is that the background image for the fields is on a different div absolutely positioned behind the text field (which has a transparent background and no border). I will spare going into the reasons for this design decision here (it's related to margins within the text field) but I thought it should be mentioned since it is critical to this question. Therefore, I have two questions: How can I stop the display of the error messages all-together? How can I instead tell the validation plugin if, for example, the name field (e.g. <input id=name ... />) is invalid then it should change the background for the relevant div (e.g. <div id=name-bg... ></div>)? Thanks for any assistance!

    Read the article

  • Jquery UI dialog does not disappear

    - by iamrohitbanga
    I am using jquery-ui tabs and dialog functionality. Each tab has a button on the page which opens a dialog. This works for one of the tabs. However if I go the second tab, the button does not work there. When I come back to the first tab, the dialog does show up but the problem is I notice as I make switches back and forth to the first tab, it keeps on inserting new div's while the old div's have display:none set on them. I am doing this using JSP. This is how the reusable jsp looks like: <script> $(function() { var formData = null; $.ajax({ url : "addFormGenerator.html", success : function(data) { formData = data; $("#addFormDialog").html(data); $("#addFormDialog").dialog({ autoOpen : false, height : 300, width : 350, modal : true, buttons : { "Add" : function() { $(this).dialog("close"); }, Cancel : function() { $(this).dialog("close"); } }, close : function() { } }); } }); $("#addButton").button().click(function() { $("#addFormDialog").html(formData); $("#addFormDialog").dialog("open"); }); }); </script> <button id="addButton">Click here to Add New</button> <div id="addFormDialog" title="Add New"></div> This jsp fragment is included in other jsp pages as well. I was assuming as I switch between tabs the old button will be garbage collected. Can you help me understand the problem and fix it?

    Read the article

  • Jquery Modal Popup opens twice on Single Click with ASP.Net MVC3

    - by user1704379
    I am using Modal Popup in my MVC3 application it works fine but opens twice for a single Click on the link. The Modal pop is triggered from the 'Index' view of my Home Controller. I am calling a view 'PopUp.cshtml' in my modal popup. The related ActionMethod 'PopUp' for the respective view is in my 'Home' controller. Here is the code, Jquery code on layout.cshtml page, <script type="text/javascript"> $.ajaxSetup({ cache: false }); $(document).ready(function () { $(".openPopup").live("click", function (e) { e.preventDefault(); $("<div></div><p>") .attr("id", $(this).attr("data-dialog-id")) .appendTo("body") .dialog({ autoOpen: true, title: $(this).attr("data-dialog-title"), modal: true, height: 250, width: 900, left: 0, buttons: { "Close": function () { $(this).dialog("close"); } } }) .load(this.href); }); $(".close").live("click", function (e) { e.preventDefault(); $(this).dialog("close"); }); }); </script> cshtml code in 'PopUp.cshtml' @{ ViewBag.Title = "PopUp"; Layout = null; } <h2>PopUp</h2> <p> Hello this is a Modal Pop-Up </p> Call modal popup code in Index view of Home Controller, <p> @Html.ActionLink("Click here to open modal popup", "Popup", "Home",null, new { @class = "openPopup", data_dialog_id = "popuplDialog", data_dialog_title = "PopUp" }) </p> What am I doing wrong that the modal pop up opens twice ? Thanks in Advance !

    Read the article

  • Using jQuery with form to eliminate spam

    - by Thierry-Dimitri Roy
    I have put a form on a web page where the user can send us data. Unfortunately, the webmaster does get a lot of spam through this form and the valid submissions gets buried. I have used captcha to bypass this problem. But I think that everyone would agree that captcha is a big annoyance to users. I switched to another solution: now the URL of the submit form points to null: <form id="sendDataForm" action="/null" method="post"> ... </form> And I bypass the form submission using jQuery excellent form plugin: $('#sendDataForm').ajaxForm({ url: '/ajax-data/' }); Since then, no spam has reached the webmaster, and valid comments gets through. The only drawbacks is that users without javascript cannot send us the form. But since this is on top of a javascript web application, we can safely assume that these are not valid users. My question is: in a world where 99% of users has javascript enabled (and a mechanism for those user could be build that uses captcha), why is this solution not more used? What drawback am I not seeing?

    Read the article

  • jquery select one class from many

    - by simnom
    Hi, I'm trying to achieve the following functionality. Within a form I have multiple fields with the class name .inputField if one of these fields is selected then the div associated with that element should be shown on focus and hidden on blur. However, when I implement the code below on selecting the second element the class is applied to both. Not sure where I'm going wrong?!?!? html markup: <form class="friendlyForm" name="friendlyForm" id="friendlyForm"> <ul> <li> <label for="testField">Test field</label> <input name="testField" value="here" class="inputField" id="testField" /> <div class="helper" style="display: none;">helper text here</div> </li> <li> <label for="testField">Test field2</label> <input name="testField2" value="here" class="inputField" id="testField2" /> <div class="helper" style="display: none;">helper text here</div> </li> </ul> </form> jQuery markup: $('.friendlyForm').find('.inputField').each(function(i) { $(this).blur(); $(this).focus(function() { //Add the focus class and fadeIn the helper div $(this).parent().addClass('focus'); $(this).parent().parent().find('.helper').fadeIn(); }); $(this).blur(function () { //Remove the focus class and fadeOut helper div $(this).parent().removeClass('focus'); $(this).parent().parent().find('.helper').fadeOut(); }); }); Any pointers here would be greatly appreciated. Thanks

    Read the article

  • How to get unique value in jquery?

    - by jquerier
    I am learning jquery. I have following chunk of code in a html file: <table width="100%"> <tr> <td align='center'> <div> <a id='get_this' href='#'> <input type='hidden' id='id' value='1'><img src='images/1.gif'></a> </div> </td> <td align='center'> <div> <a id='get_this' href='#'> <input type='hidden' id='id' value='2'><img src='images/2.gif'></a> </div> </td> <td align='center'> <div> <a id='get_this' href='#'> <input type='hidden' id='id' value='3'><img src='images/3.gif'></a> </div> </td> </tr> What I want to do is, when I click any of the image, I can get the value, so that I can display the information. For example, I click the id=1, then I will display information on id1 in somewhere else. I tried this: $("a#get_this").click(function(){ var id = $('input[type=hidden]#id').val(); window.alert("You have chosen the id: " + id); }); It always return id: 1 to me.

    Read the article

  • jQuery Mobile page overrides desktop HTML div layout

    - by batjko
    I'd like to use jQuery mobile on my desktop page. I'm probably thinking of this wrongly, but I tried simply inserting a page element into an existing standard div, like this: <body> <div id="left_sidebar"> [...] </div> <div id="mylist" data-role="page"> <div data-role="listview"> [list items bla bla] </div> </div> <div id="right_sidebar"> [...] </div> <div id="site_footer"> (c) bla blub </div> </body> ...hoping that only the middle part displays the "mobile" page elements. However, that page div seems to override the entire site and turns the whole body into a mobile page (albeit displaying my listview item nicely... across the entire screen). Any idea what to do? Advice is much appreciated.

    Read the article

  • how to add jquery live to lightbox v2?

    - by Mahmoud
    Hey all I am trying to create a page that well display a gallery image, when the user clicks on any images it inlarges using lightbox v2 now after that i adding on each image a button that well submit to jcart script which well add to cart, but when the user click on the button it refreshes. so i wanted to use jquery live to submit to jcart without closing the lightbox v2 but i still dont know how to do? code used inside lightbox title is <form class="jcart" method="post" action="" name = "add" > <input type="hidden" name="id" value="".$row['pro_num']."" /> <input type="hidden" name="name" value="".$row['pro_name']."" /> <input type="hidden" name="price" value="".$row['pro_price']."" /> <input type="hidden"name="qty" size = "1" value="1" /> <br /> <input type="image" value="Submit" name="addto" src = "images/add.png" /> </form>

    Read the article

< Previous Page | 50 51 52 53 54 55 56 57 58 59 60 61  | Next Page >