jquery: switch chosen selectbox selected value on click -
I want to exchange values for jquery from one selectbox to another,
In the selectbox
Example:
It says that I have 2 dropdown selection boxes, I first used the USD & amp; On the second I have selected the URO, both the selected values are clicked on the switch button & amp;
I tried the code below, but now it is giving me what I see, it can be that you can help me
(click " "," # Sweetid ", function () {var frm = ''; var to = ''; frm = $ (" # from_currency option: val (); to = $ ("# to_currency option: selected"). Val (); $ ("# to_currency") Val (frm); $ ("# from_currency"). Val (from); // currency converter ();});
HTML code After integrating its work with simple selectbox, the same thing is not working. Any ideas? Try this one last line
& lt; select name = "from_currency" id = "from_currency">
option value = "USD"> USD : United States dollar & lt; / wil P & gt; Option value = "EUR"> EUR: Euro Update:
$ ("# switchid" ("Click", function () {var frm = ''; var to = ''; frm = $ ("# from_currency"). Val (); from = $ ("# to_currency option: selected" $ (" $ ("# To_currency"). Val (frm); $ ("# from_currency"). Val (from); $ ("# from_currency, #to_currency"). Trigger (selected " : Updated ");});
" $ ("# from_currency, #to_currency"). Trigger ("Selected: Updated"); " should be triggered selectively. I did not do this test though As I have not chosen (or at the moment)! :)
Comments
Post a Comment