Search Results

Search found 17401 results on 697 pages for 'jquery selectors'.

Page 12/697 | < Previous Page | 8 9 10 11 12 13 14 15 16 17 18 19  | Next Page >

  • JSON and jQuery.ajax

    - by Andreas
    Hello, im trying to use the jQuery UI autocomplete to communitate with a webservice with responseformate JSON, but i am unable to do so. My webservice is not even executed, the path should be correct since the error message does not complain about this. What strikes me is the headers, response is soap but request is json, is it supposed to be like this? Response Headersvisa källkod Content-Type application/soap+xml; charset=utf-8 Request Headersvisa källkod Accept application/json, text/javascript, */* Content-Type application/json; charset=utf-8 The error message i get is as follows (sorry for the huge message, but it might be of importance): soap:ReceiverSystem.Web.Services.Protocols.SoapException: Server was unable to process request. ---> System.Xml.XmlException: Data at the root level is invalid. Line 1, position 1. at System.Xml.XmlTextReaderImpl.Throw(Exception e) at System.Xml.XmlTextReaderImpl.Throw(String res, String arg) at System.Xml.XmlTextReaderImpl.ParseRootLevelWhitespace() at System.Xml.XmlTextReaderImpl.ParseDocumentContent() at System.Xml.XmlTextReaderImpl.Read() at System.Xml.XmlTextReader.Read() at System.Web.Services.Protocols.SoapServerProtocol.SoapEnvelopeReader.Read() at System.Xml.XmlReader.MoveToContent() at System.Web.Services.Protocols.SoapServerProtocol.SoapEnvelopeReader.MoveToContent() at System.Web.Services.Protocols.SoapServerProtocolHelper.GetRequestElement() at System.Web.Services.Protocols.Soap12ServerProtocolHelper.RouteRequest() at System.Web.Services.Protocols.SoapServerProtocol.RouteRequest(SoapServerMessage message) at System.Web.Services.Protocols.SoapServerProtocol.Initialize() at System.Web.Services.Protocols.ServerProtocolFactory.Create(Type type, HttpContext context, HttpRequest request, HttpResponse response, Boolean& abortProcessing) --- End of inner exception stack trace --- This is my code: $('selector').autocomplete({ source: function(request, response) { $.ajax({ url: "../WebService/Member.asmx", dataType: "json", contentType: "application/json; charset=utf-8", type: "POST", data: JSON.stringify({prefixText: request.term}), success: function(data) { alert('success'); }, error: function(XMLHttpRequest, textStatus, errorThrown){ alert('error'); } }) }, minLength: 1, select: function(event, ui) { } }); And my webservice looks like this: [WebService(Namespace = "http://tempuri.org/")] [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)] [System.ComponentModel.ToolboxItem(false)] [ScriptService] public class Member : WebService { [WebMethod(EnableSession = true)] [ScriptMethod(ResponseFormat = ResponseFormat.Json)] public string[] GetMembers(string prefixText) { code code code } } What am i doing wrong? Thanks in advance :)

    Read the article

  • Forcing an item to remain in place in a jQuery UI Sortable list

    - by calumbrodie
    I've set up a jQuery sortable list but I need to be able to keep some items in the sortable 'fixed' in place and for the other items to sort around them. I thought that there would be built in methods to achieve this, alas this is not the case. I'm able to set up the list and not include the items in question: <ul id="fruit"> <li class="fixed">apples</li> <li>oranges</li> <li>bananas</li> <li>pineapples</li> <li>grapes</li> <li class="fixed">pears</li> <li>mango</li> </ul> <script type="text/javascript"> $('#fruit').sortable({items: "li:not('.fixed')"}) </script> This stops me from drag/dropping these items but they still move if the items around them are sorted. There may be a way to do this using the many callbacks that this method has but I've been unable to work this out. Maybe this method would be a good addition to the UI Sortable options?

    Read the article

  • How to horizontally sort divs using Sortable in JQuery

    - by Tahir Akram
    I am looking to sort my divs horizontally in a container div. I found an example on JQuery website but that is vertical sorting. I want it horizontal. I want to do it sorting in #sortable Div. Will you please guide me how can I convert this vertical sorting in horizontal manner. CSS <style type="text/css"> #draggable1 { width: 150px; height: 35px; padding: 0.5em; } #draggable2 { width: 150px; height: 35px; padding: 0.5em; } #draggable3 { width: 150px; height: 35px; padding: 0.5em; } #sortable { width: 700px; height: 35px; padding: 0.5em; } </style> JavaScript <script type="text/javascript"> $(function() { $("#sortable").sortable({ revert: true }); }); </script> HTML <div class="demo"> <div id="sortable" class="ui-state-default"> <div id = "draggable1" class="ui-state-default">Home</div> <div id = "draggable2" class="ui-state-default">Contact Us</div> <div id = "draggable3" class="ui-state-default">FAQs</div> </div> </div> Screenshot

    Read the article

  • jquery Ajax sortable list stops being sortable when Ajax call updates the list html

    - by Trevor
    Hi, I am using jquery 1.4.2 and trying to achieve the following: 1 - function call that sends a value to a php page to add/remove an item 2 - returns html list of the items 3 - list should still be sortable 4 - save (serialise list) onclick My full WIP is located here [http://www.chittak.co.uk/test4/index_nw3.php][1] I tried to delegate from the level above the UL but I could get this to work $("#construnctionstage").delegate('ul li', 'click', function(){ The initial list is sortable, when you click add/remove the ajax function returns a new list with the a number of items, BUT I am doing something wrong as the alert message continues to work while the list is no longer sortable. $(document).ready(function(){ $('ul').delegate('li', 'click', function(){ alert('You clicked on an li element!'); /*$("#test-list").sortable({ handle : '.handle', update : function () { var order = $('#test-list').sortable('serialize'); $("#info").load("process-sortable.php?"+order); } });*/ }).sortable({ handle : '.handle', update : function () { var order = $('#test-list').sortable('serialize'); $("#info").load("process-sortable.php?"+order); } }); }); <div id="construnctionstage"> <ul id="test-list"> <li id="listItem_1">

    Read the article

  • how to open jquery ui dialog automatically when the page loads?

    - by rgksugan
    I need my dialog to open when the page is loaded automatically. What is the way to do it using jquery. Without any user interaction to open it. I tried this code but it dint work <script type="text/javascript" src="script/jquery-1.4.2.min.js"></script> <link type="text/css" href="css/jquery-ui-1.8.1.custom.css" rel="stylesheet" /> <script type="text/javascript" src="script/jquery-ui-1.8.1.custom.min.js"></script> <script type="text/javascript" src="script/jquery-ui.dialog.js"></script> <script type="text/javascript" src="script/jquery.bgiframe-2.1.1.js"></script> <script type="text/javaScript"> $(function(){ $('#dialog').dialog({ autoOpen: false, width: 600, buttons: { "Ok": function() { $(this).dialog("close"); } } }); $('#dialog').dialog('open'); }); </script> Please help.

    Read the article

  • jquery ui-tabs widget , changing the color of the background with css causes problem with display

    - by Ronedog
    I'm using the jquery tabs plugin and want to have the background a light grey color. In the css section for tabs, I found this line of code where I manually added the background-color part: .ui-tabs .ui-tabs-panel { padding: 1em 1em; display: block; border-width: 0; background-color:#EEEEEE;} The problem comes as seen in the picture below, where the grey background is only extending down part of the way. I initially thought I could update the div container with the same background color, but it didn't work. It looks like that white portion below might be some kind of padding, so I looked for that in the css but everything I tried had the same effect. Anyone got some ideas? This is what the HTML looks like (Theoretically): <div id="tabs_here"> <ul> <li><a href="#" onclick="$('#T_1').html('Display the data');" >Item Groups</a> </li> </ul> <div id="T_1"></div> </div>

    Read the article

  • jQuery ajax form submit - multiple post/get requests caused when validation fails

    - by kenny99
    Hi, I have a problem where if a form submission (set up to submit via AJAX) fails validation, the next time the form is submitted, it doubles the number of post requests - which is definitely not what I want to happen. I'm using the jQuery ValidationEngine plugin to submit forms and bind validation messages to my fields. This is my code below. I think my problem may lie in the fact that I'm retrieving the form action attribute via $('.form_container form').attr('action') - I had to do it this way as using $(this).attr was picking up the very first loaded form's action attr - however, when i was loading new forms into the page it wouldn't pick up the new form's action correctly, until i removed the $(this) selector and referenced it using the class. Can anyone see what I might be doing wrong here? (Note I have 2 similar form handlers which are loaded on domready, that could also be an issue) $('input#eligibility').live("click", function(){ $(".form_container form").validationEngine({ ajaxSubmit: true, ajaxSubmitFile: $('.form_container form').attr('action'), success : function() { var url = $('input.next').attr('rel'); ajaxFormStage(url); }, failure : function() { //unique stuff for this form } }); }); //generic form handler - all form submissions not flagged with the #eligibility id $('input.next:not(#eligibility)').live("click", function(){ $(".form_container form").validationEngine({ ajaxSubmit: true, ajaxSubmitFile: $('.form_container form').attr('action'), success : function() { var url = $('input.next').attr('rel'); ajaxFormStage(url); }, failure : function() { } }); });

    Read the article

  • jQuery Animate Inconsistencies between Browsers

    - by silent1mezzo
    I'm trying to figure out why this works in FireFox, Chrome but not in IE and not properly in Safari and Opera (you can view it working at http://41six.com/about/) HTML: <div id="menu"> <ul> <li> <a href="/" class="home" title="Home" alt="fortyonesix">&nbsp;</a> <div id='home-hover'>Home Page</div> </li> </ul> </div> CSS: #menu .home { display:block; height:24px; width:24px; background-image: url('../images/Home.png'); } #home-hover { position:fixed; padding: 3px 0 3px 10px; left:40px; top:125px; width: 100px; height: 20px; background-color:#000; color: #fff; z-index:9999; opacity: .9; filter: alpha(opacity=90); -ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=90)"; -moz-border-radius-topright: 5px; -webkit-border-top-right-radius: 5px; -moz-border-radius-bottomright: 5px; -webkit-border-top-bottom-radius: 5px; display:none; } JQuery: $('.home').hover(function() { $('#home-hover').animate({width:'toggle'},200); }, function() { $('#home-hover').animate({width:'toggle'},200); }); It's definitely not pretty but I'm not sure why its not working for Safari, Opera and IE

    Read the article

  • Using $.get with jquery validation

    - by Jimmy McCarthy
    I'm trying to use the Jquery builtin validator on my page. The issue is that I have certain fields that only are required if the JobID (entered into another field) does not already exist in our database. I have a simple service which simply takes JobID and returns True or False based on whether the JobID exists, but I can't seem to get this information where I want it. Some sample code: $("#dep_form").validate({ rules: { JobID: { required: true, digits: true, minlength: 3 }, OrgName: { required: function(element) { //This field is required if the JobID is new. return $("#jobinfo").html().length==15; } } }, messages: { JobID: { required: "Enter a Job Number.", digits: "Only numbers are allowed in Job ID's.", minlength: "Job Number must be at least 3 digits" }, OrgName: { required: "Select a Practice from the dropdown list." } }, errorClass: "ui-state-error-input", errorLabelContainer: "#errorbox", errorElement: 'li', errorContainer: "#validation_errors", onfocusout: false, onkeyup: false, focusinvalid: false }; Currently, I'm using a lazy method to validate (shown above). However, I now have access to a service using the URL: var lookupurl = "/deposits/jobidvalidate/?q=" + $("#id_JobID").val() + "&t=" + new Date().getTime(); which is a page which will contain just the word True or False based on whether that given JobID exists. I've tried half a dozen different ways of setting variables and calling functions within functions and still cannot get a way to simply return the value of that page (which I've been trying to access with $.get() ) to my validator, so that required is set to true when the Job does not exist and false if the job already exists. Any suggestions? Thanks.

    Read the article

  • Follow the links of the tab in jquery ui tab

    - by Aakash Chakravarthy
    Hello, I have jquery tabs like <ul id="tabsList"> <li><a href="#tab-1">Name 1</a></li> <li><a href="#tab-2">Name 2</a></li> <li><a href="http://www.google.com/">Name 3</a></li> </ul> <div id="tab-1">content 1</div> <div id="tab-2">content 2</div> the first two tabs load the respective divs. But the third one should go to google.com, instead it does nothing. It just adds http://example.com/index.html#ui-tabs-[object Object] to the url. I am developing a wordpress plugin and the admin page needs a tab interface. I tested this in a local server and not working update: i don't want to load google.com inside the page. It should open the webpage in new tab/window like ordinary links do.

    Read the article

  • jquery-sortable using behavior of a linkedlist

    - by BabaBooey
    I suspect I'm not looking at this issue in the right way so here goes. I have essentially a LinkedList of data on a web page (http://en.wikipedia.org/wiki/Linked_list) that I'd like to manipulate using traditional Linked List behavior (i.e. just updating the reference/id of the "next" object) for performance reasons. Where this gets a bit tricky is I'd ideally like to use Jquery's sortable to do this. Like the user would drag something up/down and I could just do an Ajax call to the server with the id of the object that moved and the new parent id of that object (and then behind the scenes I could figure out how to reconnect things..maybe need more data than that...). But every example I've seen where sortable is used they were sending the whole re-indexed list to the database to update which seems unnecessary to me. With a linked list to change an element's "index" I only need to make 3 updates which depending on the size of the list could be a big performance savings. Anyone have an example of what I'm trying to do...am I too far in left field?

    Read the article

  • jQuery validate and tabs

    - by ntan
    Hi i am using jQuery validate for my form validation. The form is inside tabs.When i get an error i add an icon to the tab that error exist to be visual by the user So far so good. My problem is that after correct the error i can not remove the error in tab icon. I was assuming that validator is accessible via success but its not Assuming that the first tab (tab0) has 3 field for validation (field1,field2,field3) Here is the full code $("form#Form1") .validate({ invalidHandler: function(form, validator) { //TAB 0 if (validator.errorMap.field1 != "" && validator.errorMap.field2 != "" && validator.errorMap.field3 != "") { if ($("#tabs>ul>li").eq(0).find("img").length == 0) { $("#tabs>ul>li").eq(0).prepend("<img src=\"error.gif\">"); } } }, errorClass: "errorField", errorElement: "p", errorPlacement: function(error, element) { var parent = element.parent(); parent.addClass("error"); error.prependTo( parent ); }, //validator in not accessible via success //so my code its not working success: function(element,validator) { var parent = element.parent(); parent.removeClass("error"); $(parent).children("p.errorField").remove(); //TAB 0 if (validator.errorMap.field1 == "" && validator.errorMap.field2 == "" && validator.errorMap.field2 == "") { if ($("#tabs>ul>li").eq(0).find("img").length == 0) { $("#tabs>ul>li").eq(0).find("img").remove(); } } }, rules: { field1: { required: true }, field2: { required: true }, field3: { required: true } } }); Any suggestion is welcome.

    Read the article

  • Something like jQuery's .resizable but without the div's inside

    - by Brendon Muir
    Hi everyone, this is just a quick probe to see if this is technically possible. I'm wanting to enable the resizing of an image in the browser (also within a contentEditable area). Firefox and IE already allow this to be done with their inbuilt handles and it works fine. I'm wanting to implement something for Safari however because it doesn't support this natively. I've had a go with jQuery's resizable method and it does a very good job, however it relies on inserting a bunch of div's along with the image and wrapping that in a big div. This would normally be fine if we weren't concerned with the code generated in the contentEditable area, but we are because it's going to be saved back to the server. I could strip this extra stuff out on save, but I was thinking, is it technically possible to create a resizing script for images that doesn't rely on adding extra div's? Even if we decide to go without handles for now, and just concentrate on detecting when a user is close to the edge of the image, change the mouse cursor to a resizing one, and detect clicks and drags in the 5px's around the edge of the image, is this possible? If it's possible, I'm assuming (hoping) that perhaps it's already been done, but my searching hasn't turned up anything so far. Keen to hear any ideas :)

    Read the article

  • [jquery] multiple resizables acting strange

    - by Noweem
    Hi there everyone, I'm trying to place multiple resizable and draggable div's on one page that move (vertically) inside their own parent div. you can take a look at http://bit.ly/bCutBE However, these div's act really strange when I want to resize them, especially from the north side, they kind of move out of the screen very fast, while they shouldn't be able to get outside the parent div. I only want the div to be able to move and resize vertically inside it's parent, the dragging-part works pretty good, but the resize part give this problem. I can't really describe it better than this, but take a look for yourself and it will be clear immediately when you try to resize one of the coloured div's: move it a little downwards and try to resize it from the north side. the problem seems to be caused by the containment: 'parent', line of the resizable. when I delete this line it works fine, but then the coloured blocks don't stay in their parent, and I want them to stay inside their parent. I hope someone can help me with this... the jquery code I used: $(document).ready(function(){ $(".move") .draggable({ containment: 'parent', grid: [50,50], axis: 'y' }) .resizable({ containment: 'parent', grid: [50,50], handles: 'n, s', minHeight: 50 }); });

    Read the article

  • jQuery code in ajax loaded content only runs once

    - by Michael Howland
    I have been looking around SO for a while and haven't been able to find anything that matches my issue, which I'm not even sure I can explain that well, so take that for what it's worth. I have a page that loads content into a div via AJAX (using the .load() method). There are several links in the navigation, meaning the content will change while navigating the site without refreshing the entire page. (Actually, to be honest, I just cribbed the DocTemplate layout [http://css-tricks.com/examples/DocTemplate/] from css-tricks.com. Apparently while I'm not a re-invent the wheel type programmer, I am a bash my head against the wheel incessantly to get it to work programmer.) So, index.php loads up some DB content in a div. There is also a jQuery UI modal input form on index.php. Essentially, the only HTML on the page is an empty div and a form. This all works fine, until I call up another page, then go back to index.php. The DB content is not loaded, and my form is shown there in all its naked glory. I know why this is happening. The page was not refreshed, nothing kicked off the code to load the content and hide the form. My question is, how can I ensure that the AJAX .load() and the .dialog() will run when loading index.php again? Is it even possible? Thanks, and my apologies for the length. I get verbose when I'm confused.

    Read the article

  • The Classic jQuery Tabs with Bing Maps Issue

    - by Justin
    Hello, I know that there are multiple issues with jQuery Tabs and using Maps. And I have seen the multiple fixes and I am half-way there. But I have the most obscure issue and hoping that someone might understand why. This is my code for the tabs $("#contactTabs").tabs({ spinner: 'Loading <img src="../images/icons/ajax-loader.gif" />' }); $('#contactTabs').bind('tabsshow', function(event, ui) { if (ui.panel.id == "Map") { GetMap(); } }); Which currently does not work. But I was doing some testing and added in an ALERT() to see if the "GetMap()" was even attempting to be loaded... so this was the code that I tested with, and it works just fine. $("#contactTabs").tabs({ spinner: 'Loading <img src="../images/icons/ajax-loader.gif" />' }); $('#contactTabs').bind('tabsshow', function(event, ui) { if (ui.panel.id == "Map") { alert("load map"); GetMap(); } }); So I haven't a clue why adding the ALERT() causes the map to load and removing the ALERT just doesn't load the map at all. Is there any clarification that someone can give me on this issue? Thank you in advance!

    Read the article

  • Displaying a message in a dialog box using AJAX, jQuery, and CakePHP

    - by LainIwakura
    I have a form, and when users submit this form, it should pass the data along to a function using AJAX. Then, the result of that is displayed to the user in a dialog box. I'm using CakePHP (1.3) and jQuery to try and accomplish this but I feel like I'm running into the ground. The form will eventually be used for uploading images with tags, but for now I just want to see a message pop up in the box.. The form: <?php echo $this->Form->create('Image', array('type' => 'file', 'controller' => 'images', 'action' => 'upload', 'method' => 'post')); echo $this->Form->input('Wallpaper', array('type' => 'file')); echo $this->Form->input('Tags'); echo $this->Form->end('Upload!'); ?> The AJAX: $(document).ready(function() { $("#ImageUploadForm").submit(function() { $.ajax({ type: "POST", url: "/images/upload/", data: $(this).serialize(), async: false, success: function(html){ $("#dialog-modal").dialog({ $("#dialog-modal").append("<p>"+html+"</p>"); height: 140, modal: true, buttons: { Ok: function() { $(this).dialog('close'); } } }) } }); return false; }); }); NOTE: if I put $("#dialog-modal").dialog({ height: 140, modal: true }); OUTSIDE of the $.ajax but inside the $("#ImageUploadForm").submit(function() { and comment out the $.ajax stuff, I WILL see a dialog box pop up and then I have to click it for it to go away. After this, it will not forward to the location /images/upload/ The method that AJAX calls: public function upload() { $this->autoRender = false; if ($this->RequestHandler->isAjax()) { echo 'Hi!'; exit(); } } $this-RequestHandler-isAjax() seems to do either absolutely nothing, or it is always returning false. I have never entered an if statement with that as the condition. Thanks for all the help, if you need more information let me know.

    Read the article

  • jQuery autocomplete not always working on elements

    - by PoweRoy
    I'm trying to create a greasemonkey script (for Opera) to add autocomplete to input elements found on a webpage but it's not completely working. I first got the autocomplete plugin working: // ==UserScript== // @name autocomplete // @description autocomplete // @include * // ==/UserScript== // Add jQuery var GM_JQ = document.createElement('script'); GM_JQ.src = 'http://jquery.com/src/jquery-latest.js'; GM_JQ.type = 'text/javascript'; document.getElementsByTagName('head')[0].appendChild(GM_JQ); var GM_CSS = document.createElement('link'); GM_CSS.rel = 'stylesheet'; GM_CSS.href = 'http://dev.jquery.com/view/trunk/plugins/autocomplete/jquery.autocomplete.css'; document.getElementsByTagName('head')[0].appendChild(GM_CSS); var GM_JQ_autocomplete = document.createElement('script'); GM_JQ_autocomplete.type = 'text/javascript'; GM_JQ_autocomplete.src = 'http://dev.jquery.com/view/trunk/plugins/autocomplete/jquery.autocomplete.js'; document.getElementsByTagName('head')[0].appendChild(GM_JQ_autocomplete); // Check if jQuery's loaded function GM_wait() { if(typeof window.jQuery == 'undefined') { window.setTimeout(GM_wait,100); } else { $ = window.jQuery; letsJQuery(); } } GM_wait(); function letsJQuery() { $("input[type='text']").each(function(index) { $(this).val("test autocomplete"); }); $("input[type='text']").autocomplete("http://mysite/jquery_autocomplete.php", { dataType: 'jsonp', parse: function(data) { var rows = new Array(); for(var i=0; i<data.length; i++){ rows[i] = { data:data[i], value:data[i], result:data[i] }; } return rows; }, formatItem: function(row, position, length) { return row; }, }); } I see the 'test autocomplete' but using the Opera debugger(firefly) I don't see any communication to my php page. (yes mysite is fictional, but it works here) Trying it on my own page: <body> no autocomplete: <input type="text" name="q1" id="script_1"><br> autocomplete on: <input type="text" name="q2" id="script_2" autocomplete="on"><br> autocomplete off: <input type="text" name="q3" id="script_3" autocomplete="off"><br> autocomplete off: <input type="text" name="q4" id="script_4" autocomplete="off"><br> </body> This works, but when trying on another pages it sometimes won't: e.g. http://spitsnieuws.nl/ works but http://nu.nl and http://dumpert.nl don't work. Trying the autocomplete of jquery ui has more problems: // ==UserScript== // @name autocomplete // @description autocomplete // @include * // ==/UserScript== // Add jQuery var GM_JQ = document.createElement('script'); GM_JQ.src = 'http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js'; GM_JQ.type = 'text/javascript'; document.getElementsByTagName('head')[0].appendChild(GM_JQ); var GM_CSS = document.createElement('link'); GM_CSS.rel = 'stylesheet'; GM_CSS.href = 'http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css'; document.getElementsByTagName('head')[0].appendChild(GM_CSS); var GM_JQ_autocomplete = document.createElement('script'); GM_JQ_autocomplete.type = 'text/javascript'; GM_JQ_autocomplete.src = 'http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js'; document.getElementsByTagName('head')[0].appendChild(GM_JQ_autocomplete); // Check if jQuery's loaded function GM_wait() { if(typeof window.jQuery == 'undefined') { window.setTimeout(GM_wait,100); } else { $ = window.jQuery; letsJQuery(); } } GM_wait(); // All your GM code must be inside this function function letsJQuery() { $("input[type='text']").each(function(index) { $(this).val("test autocomplete"); }); $("input[type='text']").autocomplete({ source: function(request, response) { $.ajax({ url: "http://mysite/jquery_autocomplete.php", dataType: "jsonp", success: function(data) { response($.map(data, function(item) { return { label: item, value: item } })) } }) } }); } This will work on my html page, http://spitsnieuws.nl and http://dumpert.nl but not on http://nu.nl. (dumpert didn't work on the plugin autocomplete) //http://spitsnieuws.nl <input class="frmtxt ac_input" type="text" id="zktxt" name="query" autocomplete="off"> //http://dumpert.nl <input type="text" name="srchtxt" id="srchtxt"> //http://nu.nl <input id="zoekfield" name="q" type="text" value="Zoek nieuws" onfocus="this.select()" type="text"> Anyone know why the autocomplete functionality doesn't work? Why the request to the php page is not being made? And why I can't add my autocomplete to google.com?

    Read the article

  • Using jQuery validation plugin with tabbed navigation

    - by user3438917
    I have a tabbed navigation wizard, for which the first section needs to be validated before proceeding to the next tab. The validation should trigger when the user hits the "next" button. I am unable to get the validation to trigger though: <form id="target-group" novalidate="novalidate"> <div class="box"> <div class='box-header-main'><h2><img src="assets/img/list.png" /> Target Group Information</h2></div> <br /> <div class='box'> <div class='box-header-property'><h2><span data-bind="text:Name">New Target Group</span> | <i class='fa fa-file'></i></h2></div> <br /> <div class='row'> <div id='flight-wizard'> <div id='content' class='col-lg-12'> <div class='col-lg-12'> <div id='tabs'> <ul> <li id="targetgroup-info-tab"><a href='#tabs-1'><i class="fa fa-info-circle"></i>Target Group Info</a></li> <li id="zone-tab"><a href='#tabs-2'><i class="fa fa-map-marker"></i>Zones</a></li> </ul> <div id='tabs-1'> <div class='row'> <div class='col-xs-6'> <div class='form-group'> Name<sup>*</sup> <input id="selectError0" name="name" class='form-control col-xs-12' data-bind="value: asdf" placeholder='Enter Name ...' /> </div> <form class='form-horizontal'> <div class='form-group'> Product(s)<sup>*</sup> <div class='controls' id='products'> <select id='selectError3' class='form-control' data-bind="options:test, optionsText: 'Name', optionsValue : 'test', value: test, optionsCaption: 'Choose Product...'"></select> </div> </div> </form> </div> <!--RIGHT PANE--> <div class='col-xs-6'> <div class='form-group'> Platform<sup>*</sup> <div class='controls'> <select id="selectError2" class='form-control' data-bind="options:test, optionsText: 'Name', optionsValue: 'test', value : test, optionsCaption: 'Choose Platform...'"></select> </div> </div> <form class='form-horizontal'> <div class='form-group'> AdTypes(s)<sup>*</sup> <div class='controls' id='adtypes'> <select multiple="" id='adtypesselect' class='form-control' data-rel="chosen" data-bind="options:test, optionsText: 'Name', optionsValue : 'test', selectedOptions: test, optionsCaption: 'test...'"></select> </div> </div> </form> <button id="btn_cancel_large" class='btn btn-large btn-primary btn-round'><i class='fa fa-ban' /></i> Cancel</button> <button id="btn-next-large" class='btn btn-large btn-primary btn-round'>Next <i class='fa fa-arrow-circle-right'></i></button> </div> <!--end of right pane--> </div> </div> <div id='tabs-2'> <div class='row'> <div class='col-lg-12'> <div class='row'> <div class='col-lg-12'> <div id='zones_list' class='box-content'> <div id='add-new-targetgroupzone' class='add-new'><i class='fa fa-plus-circle'></i><a href='/#/inventory/targeting/' onclick="return false;">Add Zone</a></div> <table id="results" width="100%"> <thead> <tr> <th>Publisher</th> <th>Property</th> <th>Zone</th> <th>AdTypes</th> <th width='10%'>Quick&nbsp;Actions</th> </tr> </thead> </table> </div> </div> </div> </div> </div> <br /> <div class="btn_row"> <button id="btn_cancel_large2" class='btn btn-large btn-primary btn-round'><i class='fa fa-ban' /></i> Cancel</button> <button id="btn-submit-large" class='btn btn-large btn-primary btn-round'>Submit <i class='fa fa-arrow-circle-down'></i></button> </div> </div> </div> </div> </div> </div> </div> </div> </div> </form> <form id="zones-form" style="display: none;" novalidate="novalidate" class="slideup-form"> <div class="box"> <div class="box-header-panel"> <h2>Add Target Group Zone</h2> <div class="box-icon" id="zones-form-close"> <i class="fa fa-arrow-circle-down"></i> </div> </div> <div class="box-content clearfix"> <div class="box-content"> <table id="zones-list" width="100%"> <thead> <tr> <th>Publisher</th> <th>Property</th> <th>Zone</th> <th>AdTypes</th> <th width='10%'>Quick&nbsp;Actions</th> </tr> </thead> </table> </div> </div> </div> </div> </form> jQuery: $("#target-group").validate({ rules: { name: { required: true } }, messages: { name: "Name required", } }); $('#btn-next-large').click(function () { if ($('#target-group').valid()) $tabs.tabs('select', $(this).attr("rel")); });

    Read the article

  • JQuery validation not working for checkbox group

    - by Chris Halcrow
    I'm having trouble getting JQuery validation to work with a set of checkboxes. I'm generating the checkboxes using an ASP.NET checkboxlist, and I've used JQuery to set the 'name' attribute to the same thing for each checkbox in the list. Here's the code that gets written to the browser. I'm setting the 'validate' attribute on the 1st checkbox to set the rule that at least one checkbox must be selected. The JQuery validation works for all other elements on the form, but not for the checkbox list. I'm also using a JQuery form wizard on the page which triggers validation for each 'page' of the form, so I don't have control over how the validation is called. <input id="ContentPlaceHolder1_MainContent_AreaOfInterest_0" class="ui-wizard-content ui-helper-reset ui-state-default" type="checkbox" value="Famine" name="hello[]" validate="required:true, minlength:1"> <label for="ContentPlaceHolder1_MainContent_AreaOfInterest_0">Famine</label> <br> <input id="ContentPlaceHolder1_MainContent_AreaOfInterest_1" class="ui-wizard-content ui-helper-reset ui-state-default" type="checkbox" value="Events Volunteer" name="hello[]"> <label for="ContentPlaceHolder1_MainContent_AreaOfInterest_1">Events Volunteer</label> Any ideas on what's going wrong? There are lots of examples of JQuery scripts that will do the validation, however I'm trying to avoid this as I'm generating the checkboxlist server side by a custom control so that it can be re-used across different pages that may or may not have JQuery enabled. I'm trying to enable the JQuery validation whilst being as unobtrusive as possible, so that pages will still work even if JQuery is disabled. Here are the relevant JQuery inclusions and JQuery initialisation script for the form wizard. I'm not using any initialisation code for JQuery validation: <script type="text/javascript" src="../js/formwizard/js/bbq.js"></script> <script type="text/javascript" src="../js/formwizard/js/jquery.form.js"></script> <script type="text/javascript" src="../js/formwizard/js/jquery.form.wizard.js"></script> <script type="text/javascript" src="../js/formwizard/js/jquery.validate.js"></script> <script type="text/javascript"> $(document).ready(function () { $("#form1").formwizard({ validationEnabled: true, focusFirstInput: true }); }); </script>

    Read the article

  • jquery dialog - which button opened the dialog?

    - by Dan
    In the example below, how can you use the event and ui objects to detect which link opened the dialog? Can't seem to get $(event.target).attr("title"); to work properly, and I'm having trouble finding documentation on the 'ui object that is passed. Thanks! $( ".selector" ).dialog({ link_title = $(event.target).attr("title"); alert(link_title); }); $("a").live("click", function() { btn_rel = $(this).attr("rel"); $(btn_rel).dialog("open"); }); <a class="btn pencil" rel="#dialog_support_option_form" title="Edit Support Option">Edit</button>

    Read the article

  • Using jquery pagination plugin

    - by eddy
    Hi. I want to use this plugin, but I don't know if it'll meet all of my requirements. I know I have to use JSON to fetch the data from the server and then use it at the client side, is that right?. For now, that's fine, because I only have very few records, but when I have thousands of ; will it be convenient to bring all the data at once? What I would like to know is : Is there any way to query the database every time I press the number of an specific page? I ask this cause I don't think is a good idea to load all the data in one go, is it? I used to pass the id of the record I was going to edit like this : <td align="center"> <c:url value="edititem.htm" var="url"> <c:param name="id" value="${item.id}"/> </c:url> <a href="<c:out value="${url}"/>"><img src="images/edit.png" width="14" height="14" alt="edit"/></a> </td> but now I don't know not how to do it. I really hope you can help me out. Thanks in advance.

    Read the article

  • jQuery Validation, multiple form ids for same function

    - by George
    Hi have two forms with the exact same validation rules, but different ids that I'd like to combine into just one function. How can I do that? var validator = $("#ValidateForm1").validate({ errorPlacement: function(error, element) { if ( element.is(":radio") ) error.appendTo( element.parent().next().next() ); else if ( element.is(":checkbox") ) error.appendTo ( element.next() ); else error.appendTo( element.parent().next() ); } }); var validator = $("#validateForm2").validate({ errorPlacement: function(error, element) { if ( element.is(":radio") ) error.appendTo( element.parent().next().next() ); else if ( element.is(":checkbox") ) error.appendTo ( element.next() ); else error.appendTo( element.parent().next() ); } });

    Read the article

< Previous Page | 8 9 10 11 12 13 14 15 16 17 18 19  | Next Page >