jquery

jQuery/JS : empty field after success?

at my ajax call success i wish to empty the field. success: function(msg){ $(wrapperId).prepend(msg); } } I tried this: success: function(msg){ $(wrapperId).prepend(msg); $('#message').html(""); } } But it wont work ...

jquery's weird behaviour.

Hi friends, I am using codeigniter framework and in view i am using jquery. Now, I have one select box which contains values from database. I tested the values of it using jquery change event and alert box. Its giving exact value in alert box on change, but when i am using post method or get or even $.ajax(), its not giving any output. ...

JQuery $.ajax problem at safari

Hi all, I am working on a .net web project (with using c#). there is a drop down list on the page. the drop down list's onchange method calls a jquery function and this function makes an ajax call. with ajax call the handler returns the html of a renderable user control. then the jquery function locates the returned html into page. thes...

Calling PHP script with ajax and jQuery

Right now I have this: echo "<a href='misc/removeWallComment.php?id=" . $displayWall['id'] . "&uID" . $displayWall['uID'] . "&BuID" . $displayWall['BuID'] . "' title='ta bort inlägg'> <span class='removeWallComment'></span> </a>"; Its an icon with a link that removes the comment when you click. Now, it goes to misc/rem...

Append a "no results" message with jQuery

I'm using John Resig's LiveSearch with John Nunemaker Quicksilver score prototype to create a livesearch feature. I'm just trying to figure out how to append a message if no results were found, instead of just having a blank space when there are no results. Any help would be greatly appreciated. ...

How to fadeTo() everything except one div???

I am creating a tutorial and want to fade every div on the page apart from the div I want them to see. How can I do this using fadeTo? I currently have it set to fade the whole body. How can I set it to fade the body apart from div id "step2"? Code: <script type="text/javascript"> $("body").fadeTo("slow", 0.5, function() { /...

jQuery - Find any input with a given class that has no value

Hi All, I have a (very) basic validation script. I basically want to check for any inputs with class .required to see if there values are a) blank or b) 0 and if so, return false on my form submit. This code does not seem to return false: function myValidation(){ if($(".required").val() == "" || $(".required").val() == 0){ $(this)...

listBox And Jquery

could any body explain me how can i save state of two list boxes on post back i am using jQuery of this kind i dont know on what event what should i do or where can i save view state or how can i use hiddenField to persist the state of both list box <script language="javascript" type="text/javascript"> $(document).ready(functio...

Javascript: Get selected radio and paste it on a label tag with jQuery

I have a gender selection radio: <div class="label-inputs" name="userFieldDiv" id="genderUserFieldDiv"> <label class="required">Sexo</label> <input type="radio" class="check" value="F" name="userDto.gender" id="userDto.gender0"> <label for="userDto.gender0">Femenino</label> <input type="radio" class...

How to identify when select option was selected (not necessarily changed) ?

The following code displays the new selected value if it is different from the current value: HTML: <select> <option value='123'>123</option> <option value='456'>456</option> <option value='789'>789</option> </select> JS: $(function() { $('select').change(function() { alert($(this).val()); }); }); I would like to d...

File manager for ASP.NET MVC 2?

I'm trying to find a way to implement file manager functionality in an mvc 2 application. I've looked at jquery etc for ways of doing this. I have been able to implement a simple upload/download functionality with just an input file button and so on, and I have also tried out jquery File Tree (http://abeautifulsite.net/blog/2008/03/jquer...

Javascript: get a value with jQuery and replace it.

I have a gender selector, and a script that gets the value of the selected gender and pastes it on a label, but its pasting the value: "M" or "F". <div name="userLabelDiv" id="genderUserLabelDiv"> <label class="required">Sexo</label> <label id="genderLabel">F</label> </div> Now when Im trying to get this letter and replac...

Style the select list element in jEditable

How do I style the select list element? Here's my code as it is now... $('.editableSelect').editable(function(value, settings) { if (this.revert == value) { this.reset(); return; } setSaveButtonRed(this); setDescFromAccountCode(this, value); return (value); }, { type: 'select', submit: '<but...

Moving jQuery function from document ready to click event

I have a tabbed layout that shows/hides sections when a tab is clicked. I also have a tooltip function that currently loads a tooltip on an image map when the page is first loaded. I'd like to change this so that the tooltip only show when tab with an ID of 2 is clicked (#section2) or when that tab is active (in the case of linking to ...

check to see if 1st option is selected

How would I check to see if the first option is selected and then execute some code. Something like, if select box named "My_Saved_Shipping" has the 1st option selected then execute the code. <select name="My_Saved_Shipping"> <option>Select/Enter Address</option> <option value="1">text</option> <option value="2">text2</option> </selec...

the HTML script tag and non-JS content - Firefox

It appears this code will request the file in Chrome and IE but not in Firefox. <script type="text/my-custom-mime-type" src="test.ashx"> </script> Is there a some spec that says browsers should only process JavaScript related mime-types? I know IE probably supports this because of the history with vbscript. Once you have "content" li...

How can I simplify my jQuery animation?

How can I simplify my jQuery animation? What is the best way? Code: $("#nav").animate({opacity:0.2},1000); $("#sub_nav").animate({opacity:0.2},1000); $("#user_links").animate({opacity:0.2},1000); $("#logo").animate({opacity:0.2},1000); $(".top_buttons").animate({opacity:0.2},1000); $(".pageheaders").animate({opacity:0.2},1000); $(".hea...

Dynamically get changed select value JQuery

What I need to do is get the value of the selected option (when changed) in a select list and change the text in a span next to the select list. The problem is I don't know the id the the select list. There are lot of different select list on the page (5-25+) and they are all created dynamically and so I can't have the id specified in th...

Best practice for warning the user they will lose data.

I have a site which uses a lot of JavaScript (mainly jQuery) and I need a nice global way to let the user know that they will lose unsaved changes when they navigate away from a particular page. At the moment I have an onchange event placed on the inputs and wrap my main navigation in a function which will display the warning when click...

jQuery remove class on .click

Here is my html: <a href="#">Read more</a> <div class="moreDetails"> <p class="additionalText">Some text help here, random length.</p> <p class="author"> <span class="bolder"><a href="minidashboard.php?user_url=http://url.people/1332517"&gt;Name&lt;/a&gt; </span> </p> <div class="replies"> <span> <a href="topic.php?...