Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 02-08-2013, 03:04 AM   PM User | #1
eydg
New Coder

 
Join Date: Sep 2012
Posts: 72
Thanks: 2
Thanked 1 Time in 1 Post
eydg is an unknown quantity at this point
append and instantly display a message to select option

http://jsbin.com/azipok/2/edit

this piece of code does the trick of clearing up the option list of select menu and adding a "test" message, but this message becomes visible only upon dropping down the select menu.

is there a way to make this "test" message display and replace the "no modules..." text upon clicking the button?
eydg is offline   Reply With Quote
Old 02-08-2013, 03:26 AM   PM User | #2
xelawho
Senior Coder

 
xelawho's Avatar
 
Join Date: Nov 2010
Posts: 2,437
Thanks: 52
Thanked 454 Times in 452 Posts
xelawho will become famous soon enoughxelawho will become famous soon enough
you can trigger the change event, after you have appended the option:
Code:
$('#moduleselect').trigger("change")
is that what you meant?
xelawho is offline   Reply With Quote
Users who have thanked xelawho for this post:
eydg (02-08-2013)
Old 02-08-2013, 06:26 AM   PM User | #3
eydg
New Coder

 
Join Date: Sep 2012
Posts: 72
Thanks: 2
Thanked 1 Time in 1 Post
eydg is an unknown quantity at this point
Yes!! Thank you.

http://jsbin.com/azipok/15/edit
eydg is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 06:36 AM.


Advertisement
Log in to turn off these ads.