RSS

Tip of the day

06 Sep

Hi folks,

Yesterday i have faced one simple but time consuming issue, let me share with you all.

Add a value to the 0th position and make selected to the existing dropdown using JQuery.

Issue:

On Change of the dropdown1 value should fetch all the values and populate in the dropdown2. If we select another value in the dropdown1, dropdown2 values should be empty and should select default value select for the existing dropdown until the response return.

Solution:

$(“#elementId”).empty(); // Step1 : empty the dropdown

$(“#elementId”).prepend(“<option value=” selected=’selected’>Select</option>”); // Steps 2 : made default value select

Happy Learning!.

Get glued to know more updates.

Have a nice day

Advertisements
 
Leave a comment

Posted by on September 6, 2013 in Uncategorized

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: