function $.ajax return true/false ?
Hello I have the following code: function pnrexists(a){ $.ajax({ url: '/inc/chkusr.php?q=p', type: 'POST', dataType: 'html', data: {'pnr': a}, timeout: 2000, success: function(data) { if(data==1){ alert('true'); return true; }else{ alert('false'); return false; } }, }); } the code above is triggered by: $.validator.addMethod("pnrcheck", function(ph, element) { alert('1');
[jQuery] nested each - how to access parent's this??
Hi all, I'm new to jQuery and just got stuck on a problem where I'm having 2 nested $.each methods and need to access this of the parent each loop, is this possible at all?? return this.each(function() { $(selector).each(function() { // how do i get reference to this in parent each?? :-( }); }); any help appreciated M
jQuery IE and Events Question
Hello, I'm having a crazy problem with getting onclick events recognized by IE using jQuery. Sample code below. If you click on the non-popup div the onclick event is recognized in FF and IE and blah() is called. If you click on the "Click Here" text another div is created by jQuery and displayed. This div also has an onclick callback. FF recognizes this and calls blah() when this div is clicked but IE doesn't. Argh! The two divs are virtually identical except for a little positioning. Any ideas
[jQuery] I want to do validation via AJAX and then submit form...
Hey all. I am creating a login type screen and when the login button is clicked, I validate the ID/password via AJAX and if successful, I then submit the form. I have the code to validate, but when it returns a true, how do I submit the form to call the new page? Do I put the new page in the action of the form and simply call the submit function for the form? Or is there a way to use "load" in a post where it calls a program rather than loads the url into a div? ...
[Solved] Ajax each not looping in IE
I am retrieving and displaying XML data from a file. I am adding a break between each record in the each code. It works fine in Firefox, Chrome, and Safari. In IE, it only lists one record. It doesn't appear to be looping through the results. Here's the xml... <playlist> <song> <songtitle>10 Good Reasons</songtitle> <artist>Hello Kelly</artist> <duration>02:59</duration> <playtime>12:00:20 AM</playtime> <link></link>
[jQuery] dynamic content in a circular carousel
greetings, i can get a circular carousel work from within an array as per the example using itemVisibleInCallback: {onBeforeAnimation: mycarousel_itemVisibleInCallback}, itemVisibleOutCallback: {onAfterAnimation: mycarousel_itemVisibleOutCallback} i can load dynamic content from an xml file from the itemLoadCallback as per the other example. however i cannot fire the itemLoadCallback when i use it in conjunction with the ones above. any ideas on this one will be appreciated! best, aRman
[jQuery] jQuery (English)
jQuery is a fast, concise, JavaScript Library that simplifies how you traverse HTML documents, handle events, perform animations, and add Ajax interactions to your web pages. jQuery is designed to change the way that you write JavaScript. http://astronomii.webs.com/
[jQuery] adding html to tab labels
i'm trying to add some html to the label area of tabs in order to add an icon and also some divs that i can access at later times to modify easily. any suggestions on how to do this? at the moment i'm doing something like this $("#tabs").tabs('add' , '#' + tag, '<div><div id="' + tag + '_tabIcon" style="float: left;"><img src="images/icons/group_edit.png" width="16" height="16" border="0" /></div><div id="' + tag + '_tabLabel" style="float: right;">' + nick + '</div></div>'); it does what i want
Click Link Fill Input
Okay, So I have a list of names. First Name, Middiel Initial, Last Name, and Suffix So I have John Smith Bob A. Johnson Jr. Sally P. Thompson etc etc etc I have a form that has four fields, for First, Middle, Last, and Suffix. How can I click on a name and have each section auto fill the correct field? The names are being pulled dynamically from a database so I was thinking to wrap each part of the name with a span and class and then when you click on it so how use .val() and maybe .hasClass() If
Validation Issue
I have about 10 fields on a form and I would like to validate not one required field but 3. Meaning one of 3 fields has to be entered in order for the form to be valid. Example: <input id='SemiRequiredField1'></input> <input id='SemiRequiredField2'></input> <input id='SemiRequiredField3'></input> The form is valid if one of 3 semirequiredFields in entered. How do I do this? I now use the following method for validation: $("#vehicleDetailsForm").validate({ rules: { Make: { required: true
[jQuery] Decide then its error/success on ajax submit?
Hello I use the validation plugin and the following code: submitHandler: function(form) { $('#submit').attr("disabled", "true"); $.ajax({ type: 'POST', url: 'submit.php', data: $('#registerform').serialize(), error: function() { $('#mess').html("Failure"); $('#mess').css("display", "block"); alert('Fail!'); }, success:
[jQuery] Select All Elements with Class Name Beginning With String
This line worked for jquery 1.2.6: $('li[@class^=className]') This doesn't work for version 1.3.2 Is there some other syntax that works?
[jQuery] Combining jQuery validation, ajax Submit and jqUploader
I have a form, and i want to combing jquery validation ajax Submit and jquploader. This is the script $("#RegForm").validate({ submitHandler: function(form) { jQuery(form).ajaxSubmit({ var str = $("#RegForm").serialize(); $.ajax({ type: 'POST', url: 'ajax.php', data: str, success: function(msg) { if(msg == 'OK') { $('#status').html('<b>Data
[jQuery] listnav related - DL
I have a need for the listnav plugin to work for definition lists. http://www.ihwy.com/Labs/jquery-listnav-plugin.aspx Since the plugin breaks the lists up alphabetically it seems like it would make the most sense for definition lists but the "Features" section only mentions it working for ordered and unordered lists.
[jQuery] JSON handling: A modest non-proposal
Hello all, Please consider the following snippet of code, which transparently intercepts all Ajax requests, detects whether the data being POSTed is a JSON object, and based on that, switches the content type to "application/json", and serializes the data to a string: $(document).ready(function() { $._ajax = $.ajax; $.ajax = function(s) { if (s.data && s.type == 'POST') { if (typeof s.data == 'object') { JSON.stringify(s.data); s.contentType
Different duration/pause for each panel in a rotating tabs
Is there a way to specify different duration for each tab/panel for the rotating tabs. (e.g. I want Panel 1 to pause for 5 seconds and the rest of the panels to pause 2 seconds before moving onto the next tab/panel) is this possible? Thanks.
[jQuery] Ajax capability question
Hi All, I am posting to this group because of the number of members here. My question is really about ajax and not specific to jQuery (however if there is a specific jQuery solution please let me know). My question is this: Is it possible to send an ajax request to make an http request and not receive a response until the page has completely finished processing? I am trying to setup a dashboard to kick off data refreshes for cached data in various Intranet applications. They can all be run via URL's...
[jQuery] Multiple JSON objects - using results from one JSON object within a parse of another JSON object
Third time a charm.... Attempt to post again..... Hi All, I have a JSON object (called 'dataloggers') that I am retrieving via $.getJSON, and then creating a table dynamically with the results . I can parse it just fine with $.each(). The structure looks like this: { "dataloggers": { "TA_124A": { "values": { "one": "wake", "two": "up", "three": "time", "four": "to", "five": "die" } }, "TA_109C": { "values": { "one": "this", "two": "is", "three": "not", "four": "a", "five": "test" } } } } Here is
[jQuery] nested each
Hi all, Is there a way to get reference to parent's this in nested each method return this.each(function() { $(selector).each(function() { // how to get reference to parent's current this :-( }); }); thx in andvance for any help.
[jQuery] Multiple JSON objects - using the parsing results from one JSON object within another $.getJSON $.each() parse of another JSON object
Hi All, I have a JSON object (called 'dataloggers') that I am retrieving via $.getJSON, and then creating a <table> dynamically with the results . I can parse it just fine with $.each(). The structure looks like this: { "dataloggers": { "TA_124A": { "values": { "one": "wake", "two": "up", "three": "time", "four": "to", "five": "die" } }, "TA_109C": { "values": { "one": "this", "two": "is", "three": "not", "four": "a", "five": "test" } } } } Here is the code I have for processing the 'dataloggers'
[jQuery] Datepicker
Hi all, I am using the jquery datepicker with the 'buttonImage'. What I am trying to do is just when the mouse is over the image, to change it to a hand rather than a pointer. Any ideas anyone? Thanks in advanced!
[jQuery] How to make a secured login form
How to secure this jquery+php+ajax login procedure ? $('#myform').submit( function() { $(this).ajaxSubmit( { type:'POST', url:'login.php', success: function(msg) { **** login ok : how to call the welcome.php *** }, error: function(request,iderror) { alert(iderror + " " + request); } }); return false; }) <form id="myForm" action="" > Name : <input type='text' name='login' size='15' /> <div>Password : <input type='password' name='passe' size='15' /
[jQuery] show/hide on hover event (newbie question)
Hello I have a simple div inside which I want to show an image on hover (rollover) and hide on mouseout of the div. I tried doing it with toggle() but that will only change the visibility on hover. How can I do that? Thanks for help!
[jQuery] referencing parent window forms from thickbox window
on my main page. i have a form which users need to fill out data. i have a link on the form which opens up an iframed thickbox window. this iframed window has a form which lets users select diff data. once they select their data, i want the thickbox window to close and pass some data to the form on the main page. i used to use popup windows for this and was able to reference and update the mainpage form by using window.opener.document.formname. but with thickbox i cant seem to use window.opener any
[jQuery] Problem with class attribute: Why this work in 1.2.6 and doesn't work on 1.3.1???
Hi everyone!! Well... for me it's just the same thing, but I don't know why this works in 1.2.6 and doesn't in 1.3.1: if ($('.trSelected').length == 2) { alert("hello"); } In this case, I'm selecting rows on flexigrid and used to work just fine in 1.2.6. To work in 1.3.1, I had to do this: if ($('#flexDiv .trSelected').length == 2) { alert("hello"); } I had to specify the table from where the trSelected are... why does this happens?? I'm having too many problems with class attibutes. For example:
[jQuery] Selectbox Manipulation...Works in FF but not in IE6 or IE7
Hi folks, I'm trying to manipulate which item in a select box is selected using jQuery. The following code snippet works great in FF but fails miserably in IE6 and IE7 <div class="sourceRow hovered"><a class="sourceLine"> </a><span class="sourceRowText">// select the publish to option</span></div> <div class="sourceRow"><a class="sourceLine"> </a><span class="sourceRowText">$("#PublishToID > option").each(function(){</span></div><div class="sourceRow"><a class="sourceLine"> </a><span class="sourceRowText">$this
[jQuery] Problems getting validate plugin to work with select box
I'm trying to get the validate plugin to work with a select box, but for some reason, it wont validate if i select a country, what am i doing wrong? <form id="testform" method="post"> <select name="country" id="country"> <option value="">Select a country</option> <option value="AF">Afghanistan</option> <option value="AX">Aland Islands</option> <option value="AL">Albania</option> <option value="GB.WLS">Wales</option> </select> <input id="submitbtn"
[jQuery] How open a painel in jQuery Accordion after a click event??
Hi everyone! I have 2 painels in my Accordion. One has a form and the other has a flexigrid showing me all data. What I needed is when I save data to database via $ajax, I change the form painel to the flexigrid painel, but so far I haven't been successful. this is what I'm doing: $("#btnAdicionarParametro").click(function() { $.ajax({ type: 'POST', data: $("#frm").serialize(), url: '/SuperAdmin/SalvaParametro', success: function() { gridParametros.flexReload(); $(function() { $("#accordion").accordion({
[jQuery] blockUI plugin fails in IE
I am trying to use blockUI to block the siblings of a div when the div is in "edit" mode, i.e.: <div class="modules"> <div class="module" id="myDiv1" /> <div class="module" id="myDiv2" /> <div class="module" id="myDiv3" /> ... </div> <script> var $active_module = $('#myDiv1'); $active_module.siblings().block(); </script> This works in FF3 just fine, but in IE I get an error: Unexpected call to method or property access. The error points to jQuery itself, this line inside the append method: this.appendChild(
[jQuery] Pagination control jquery -- Need some help
I wrote this jquery to basically dynamically build a paging control for long articles, etc.... I have it dynamically generating a UL, a page selector and a drop down selector and I just need to write a piece that will do a <-Prev and Next -> and my brain is having trouble with it. Here is the code in simplified form. I also don't have the coding for the contect highlighting done yet to show what page we are on. HTML: <div id="headerUL"><!--UL goes here--></div> <div id="page1" class="page" title="Section
[jQuery] $('#tab1 tr:gt(0)>td').filter(':nth-child(2n+1)') select also 1st td in row - aargghh
Hi guys this drives me crazy. why does this also select the first td in each a row? $('#tab1 tr:gt(0)>td').filter(':nth-child(2n+1)') Please give me a hint :-) Thanks a lot Gerald
[jQuery] ?? About the "window=this" in the source code of the jquery
I write a code like below to use "window=this", but it is wrong!! <html> <head><title>this example</title> <script language="Javascript" type="text/javascript"> window=this; function dosomething(){ this.style.color="red"; } window.onload=function(){ document.getElementById ("h").onclick=dosomething; } </script> </head> <body> <hl id="h">this example</h1> </body> </html> the right code is cancel the "window=this", why? why use the "window=this" in jquery source code???
[jQuery] position problem ( div is going up )
Hi all, I have 2 different div which names are is "insideParent" and "insideParent2" . And when I click the Add Element button the new div is creating inside the insideParent. the problem is when I create a new div , the second div's position is changing.. Its going down.. Also when I clicked the "Remove Element" button, Its going up. Is there a way to do it static. Not : this two div is draggable and All my codes are below.. <script type="text/javascript" src="js/dragYeni/new/ jquery-1.2.6.js"></
[jQuery] Overlay not working on jquery-ui-personalized-1.6rc6.min.js
This is my code: --------------------------------------------------------------------------------------- <script language="javascript" type="text/javascript" src="/js/ jquery-1.3.2.min.js"></script> <script language="javascript" type="text/javascript" src="/js/ jquery-ui-personalized-1.6rc6.min.js"></script> <script language="javascript" type="text/javascript"> $(function(){ /* Modal Dialog Box Configuration */ $("#addproductsForm").dialog({ bgiframe:
[jQuery] How to Open Modal Dialog box on button click?
Once "btnAddSession" button is clicked, the div with the "addproductsForm" ID should open as a modal dialog box. In Firefox it opens properly while in IE it submits the page even with return false; HTML --------------------------------------- <h3>Products</h3> <!-- Placeholder for ajax results --> <div id="mainproducts"></div> <input type="submit" name="btnAddSession" value="Add Session" id="btnAddSession" /> <!-- Placeholder for the insert form --> <div id="addproductsForm" class="insertForm"> <ul>
[jQuery] Issue with .text() and line breaks
Im building a form parser(plugin) that will build a json object to a specific design. One problem I am having involves how I render some html and subsequently read that html. I am new to jQuery so please forgive me if I am missing something simple. Consider the following snippet <span>some text</span> jQuery('span').text() yields 'some text' which is what I expect. now consider this html snippet <span>some text </span> jQuery('span').text() yields 'some text\n' which is the
[jQuery] pixastic + jquery: anyone ever work with these two?
Hi, I stumbled upon Pixastic recently and thought it perfect for a current project. I've implemented it on hover function swapImages() { var img1 = $j("#cell1 img"); $j('.cell-wrapper .cell').hover(function(){ $j('img', this).pixastic("desaturate"); }, function(){ $j(this).children('.image').html(img1); }); } code works fine...but if i perform the action more than twice, i get this error in firebug: uncaught exception: An invalid
[jQuery] How can I make no tab having focus on initial load....
I know how to make a specific tab the "default" tab selected, but how do I make none of them selected? I can pass either nothing (), (1) or (2) etc for that tab to be selected so I tried passing a 0 but it still selected the tab 1. ????
[jQuery] A way to POST this?
Here is my code: http://pastebin.com/m2c7d97bd Now you see i want to post "lol". When you load the page, it will POST to this form: http://pastebin.com/m4ceeeef4 Now my problem is that it does not POST "lol"... it doesn't even post anything. Is there a way to do this? I've been searching for a while now and still no help. Thank you.
[jQuery] position problem
Hi all, I have 2 different div which names are is "insideParent" and "insideParent2" . And when I click the Add Element button the new div is creating inside the insideParent. the problem is when I create a new div , the second div's position is changing.. Its going down.. Also when I clicked the "Remove Element" button, Its going up. Is there a way to do it static. Not : this two div is draggable and All my codes are below.. <script type="text/javascript" src="js/dragYeni/new/jquery-1.2.6.js"></
Next Page