jquery

How can I ask a web user for confirmation if he really wants to leave the page?

How can I ask the user Are you sure you want to leave the page? Like for example if you click the back button while asking a question on Stackoverflow? ...

Problem passing variables through html, javascript and php.

I'm using JEditable and trying to populate a select based on a variable. I need a way to pass a variable from my page back through the JQuery to dynamically create the select. JQuery: $(".dblclick_district").editable('miscfreqs.php?mode=save_edit&module=miscfreqs&type=district', { type: 'select', loadurl: 'tools.php?mode=get_d...

remove name from dynamically created hidden input

I have a div that is being duplicated dynamically. After duping it, I need to remove the name from the hidden input only, but can't seem to be able to select it only. The majority of the file is prototype, but I have jQuery at my disposal (jq). I have managed to get the name to disappear, but it clears them all out, I only want it clea...

Search a select list with jquery

I'm trying to build a search box for a select list, and I'm looking for some suggestions on doing this with jQuery. My goal is to hightlight <option/>'s that contain the search string or hide all <option/>'s that don't. I thought I was on to something with attribute selectors until I realized that I'm searching on the HTML content and no...

JQuery/Spring: How to POST JSON but return html

When I post a JSON to the server and return a normal View string from the Spring controller, my jQuery is not hitting the "success" function. My Controller: @RequestMapping(value = MappingConstants.RULE_ASSIGNMENT, method = RequestMethod.POST) public String saveRuleAssignment(@RequestBody RuleAssignmentCO ruleAssignment) { // Some con...

die() on single elements

I've attached some live() listeners in order to automatically make ajax calls for every link with ajax in the url: $("document").ready(function() { $('a[href^="/ajax"]').live('click', call); }); function call(e, context, link) { e && e.preventDefault(); link = link || this; if(typeof link == "string" || !$(link).hasClas...

jQuery - Form Validation Plugin - One that works well?

Wait- please don't suggest the Validation plugin until reading.... I've looked into it.. I'm building a landing page with a signin and signup form. Here's is what I want to happen: Anytime a user clicks in a field, I want there to be an indication visually if the input is ok. and I want that to stick after they click to the next field...

Is there an ajax `select`?

Autocomplete inputs make life easier. However, I am working on a project where the customer insists on having ordinary inputs (radio buttons, checkbox groups and drop down selects). I don't want to change sever-side code and plan to write a javascript function to create these form elements on the client side. I think the best approach is...

IE8: Div hover only works when background color is set, very strange, why?

Situation: Got a div with buttons images. Div needs to fadeIn on hover. Works in all browsers, except Internet Explorer. When I give the div a background color it suddenly works. Check: http://ListAndPlay.com , top left are the controls. The hover won't work in IE, try to add a background color to #buttons and it suddenly works. Quest...

Why does the same code display differently on different pages?

Hi have a small entry form that is jquery driven. It works fine on 90% of the pages, but on two pages, the Submit button is out of alignment. I have checked the html and the jquery on working and non-working pages and can't see the difference. I would appreciate another set of eyes taking a look to see what is causing the Submit button t...

WebApp that communicates using only json objects?

Hey everyone, I've been thinking about how the majority of web apps works at the moment. If as an example the backend is written in java/php/python what you probably see is that the backend is "echoing / printing" the html ready to the browser, right. For web apps that works using almost exclusively ajax, is there a reason to not simpl...

Why is there a need to send JSON as string while passing parameters to WCF from jQuery

Until yet I was using httpHandlers for performing all server side logic and these httpHandlers were being called by jQuery $.Ajax. In this case to pass any parameter I used to pass pure JSON object (obviously key value pairs) which was automatically translated to the Request.Form keys on serve side. Now as I am trying to call WCF endpo...

jQuery setTimeout with overlay on submit

I have a form that uses a jQTools overlay and jQuery .ajax submission routine. I would like the overlay to close once the success/error message has been displayed. How would I incorporate a setTimeout into this (only after success/error msg has been displayed) the ID of the overlay is "#overlayForm" $.ajax({ type: $(form).at...

jQuery AnythingSlider not displaying multiple Google Visualization API charts

Hopefully someone out there is familiar w/the AnythingSlider tool... Here's the deal: I am able to put all sorts of content into this tool (which really just uses one set of < li > tags per div or whatever content you want to put per slide. I have no problem putting Google Maps, Google StreetView, pics, etc in this thing at the same ti...

How can I send an array variable to a ColdFusion CFC remote method via ajax using jQuery?

I have a ColdFusion CFC function like this: <cffunction access="remote" name="getResults" returntype="struct" returnformat="JSON" output="no"> <cfargument name="q" required="true" type="array" /> ... </cffunction> How do I call this function from jQuery? Neither form of array encoding by jQuery will get ColdFusion t...

[Need Suggest] The best validation library technic

I want to write a plugin to validate forms. I have made detailed research about that but I want to write it with my own way. I dont want to write so many lines of code when using the library. It should be easy to use. I found a jQuery library for validation. It uses HTML classes. For example if you want to a field with presence validat...

Parsing JSON data including date creates wrong Date object.

I make an ajax call with jQuery 1.4.2 with dataType: 'json'. $.ajax({ url: url_with_json_formated_response, data: jsonOptions, dataType: 'json', error: function(XMLHttpRequest, textStatus, errorThrown){ alert('unable to get data, error:' + textStatus); }, ...

jQuery Validatation Plug-in How to show an Error Image but no text

Hello. I'm learning how to use the jQuery validation plug-in. What'd I'd like to do is only show an ICON (css bkg) if the field is valid or in error. Right now the plugin requires me to add text, but I don't want any... Ideas? Code Below: /* Sign In Form Validation */ $(document).ready(function() { // validate signup form on ke...

Background color changing problem

Hello everyone! I'm trying to change element's background-color using random colors from an array. There is the code: $(document).ready(function(){ var randomColors = ['#00eeff','#fcff00','#9600ff']; var rndNum = Math.floor(Math.random() * randomColors.length); $("div.anyclass").hover( function() { $(this).css({'background-...

JQuery ThemeRoller custom theme further customisation

I have created a custom theme with ThemeRoller. I would now like to customise the checkboxes so that their active state is a different colour to the 'clickable: active state' which was chosen in the ThemeRoller. Despite trawling the various css files provided by the custom theme, I cannot for the life of me work out how to do this. I can...