I have some HTML code as follows:
<input name="bid" type="radio" value="1" id="1234"/>
<input name="bid" type="radio" value="2" id="5678"/>
<input type="text" id="paymount" name="paymount" value=""/>
Desired functionality:
When radio=1
is checked, the paymount
field value will show as 1234
. When radio=2
is checked, the paymount
field value will show as 5678
.
I have found posts on Stack Overflow, but a lot of them are related to hiding a text field.
id
for storing the value sinceid
values starting with a number are prohibited: developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id web author must not use it to convey any information – Joshua 18 hours agopaymount-low
andpaymount-high
and use thevalue
for the numbers, or you define an attribute likedata-paymount
and store the numbers there. – Joshua 16 hours ago