javascript - HTML select field updating another -


I am trying to create a webpage to merge vendors in my database and thus with two selected fields One page is:

   

Actually, when you select an option in the first field, it should be disabled or removed from another area, I could just solve this list by recapitalizing it, but it seems That's what I'm trying to achieve. That being said, I have yet to find a way to do this with javascript or jquery.

Your other similar & lt; Select & gt; In , I have changed the ID attributes to end with the number 2 .

Then you can easily do something like this:

Try this:

  $ ('# vendor_select_from' ). Change (function () {var selected = $ (': (' disabled ',' disabled ') .siblings (). RemoveAttr (' disabled '); var $ select2 = $ (' selected ', this) [0]. Id = 2; $ ('#' # # vendor_select_from2); if (selected: == $ (': selected', $ select2) [0] .id) {$ select2.val ('');}}) Trigger ('change');  

HTML

  select name = "vendor" id = "seller_check_prom" & gt; & lt ; Option value = "apple" id = "id0"> apple   

Update: This is the second & lt; Select & gt; has been changed to clear on two matches.

Update: A little clean things.


Comments

Popular posts from this blog

c# - sqlDecimal to decimal clr stored procedure Unable to cast object of type 'System.Data.SqlTypes.SqlDecimal' to type 'System.IConvertible' -

Calling GetGUIThreadInfo from Outlook VBA -

Obfuscating Python code? -