开发者

How to change a radio button value from a textbox value

开发者 https://www.devze.com 2023-01-30 11:41 出处:网络
i would love to have the textbox value as my radio button value. For example, if I type \"1\" in the textbox, then the radio button value would change to \"1\".I hope i could find answers here. By the

i would love to have the textbox value as my radio button value. For example, if I type "1" in the textbox, then the radio button value would change to "1".I hope i could find answers here. By the way, i am using Joomla, and if there are javascripts, pls tell me whe开发者_如何学编程re to paste it. thanks so much!!!


Never mind, i solved it :D here it is.

$('#textbox').keyup(function(event){ var value = $(this).val(); $('#radio').val(value); });

you also need to change the value of your #radio to the id of your textbox e.g

0

精彩评论

暂无评论...
验证码 换一张
取 消