By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,624 Members | 1,740 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,624 IT Pros & Developers. It's quick & easy.

value is modified in the gui only when the Radio Input looses focus

P: n/a
Hi,
I want to change the value of a submit button when the onChange event is
fired by a Radio Input.
Problem is, it seems the value is modified in the gui only when the Radio
Input looses focus, not when its value is changed by the user.

How can I make the value on the submit button change immediately upon action
on the radio input and not when focus changes ?

Thanks...

--- bits of code : html ---

<INPUT TYPE="RADIO" NAME="CFGWEB01" onChange="comboChange('CFGWEB01')" VALUE
= "ASGes">

<input type="submit" name="submit" value="1st value">

--- js ---

document.forms[0].submit.value='Other value';
Jul 23 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
DU
MarsVoyager wrote:
Hi,
I want to change the value of a submit button when the onChange event is
fired by a Radio Input.
Problem is, it seems the value is modified in the gui only when the Radio
Input looses focus, not when its value is changed by the user.

How can I make the value on the submit button change immediately upon action
on the radio input and not when focus changes ?

Thanks...

--- bits of code : html ---

<INPUT TYPE="RADIO" NAME="CFGWEB01" onChange="comboChange('CFGWEB01')" VALUE
= "ASGes">

IIRC, onchange is not supported for radio button; onclick is though for
radio buttons.
<input type="submit" name="submit" value="1st value">

--- js ---

document.forms[0].submit.value='Other value';


DU
--
The site said to use Internet Explorer 5 or better... so I switched to
Mozilla 1.7.5 :)
Jul 23 '05 #2

P: n/a
Thanks !
IIRC, onchange is not supported for radio button; onclick is though for
radio buttons.

Jul 23 '05 #3

P: n/a
DU wrote:
[...]

IIRC, onchange is not supported for radio button; onclick is though for
radio buttons.


As far as I can see, onchange is supported for all input
controls, including radio buttons. However, the spec also says
that the onchange does not fire until the control loses focus and
has been changed. So clicking on the radio button does nothing
until you click somewhere else to cause the control to lose focus.

IE implements this to the letter, which means that if you click on
one control, then another, the onclick of the first fires when you
click on the second and the second when you click somewhere else
(back on the first maybe?).

Firefox, on the other hand, fires the onchange when the control is
clicked, which is more intuitive but not what the spec says.

*onchange*
<URL:http://www.w3.org/TR/html4/interact/scripts.html#adef-onchange>

*radio button*
<URL:http://www.w3.org/TR/html4/interact/forms.html#radio>

Hence, onclick is often used instead.

--
Rob
Jul 23 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.