Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Javascript (http://www.velocityreviews.com/forums/f68-javascript.html)
-   -   Enable/Disable form elements (http://www.velocityreviews.com/forums/t873023-enable-disable-form-elements.html)

Age Bosma 10-10-2003 09:56 AM

Enable/Disable form elements
 
Hi,

I've got a serie of radio options in a form, if the last option gets
selected I want it to Enable a different (text) form field.
Is it possible to monitor if a radio button in a form get's unselected
instead of supplying the same piece of JavaScript code for each other
radio option?

Situation:

<fieldset>
<legend><b>7. Are you still alive?</b></legend>
<input type="radio" name="q7" value="yes"
onclick="document.surveyform.nocodec7.disabled=tru e;" />Yes<br />
<input type="radio" name="q7" value="abit"
onclick="document.surveyform.nocodec7.disabled=tru e;" />A little bit<br />
<input type="radio" name="q7" value="no"
onclick="document.surveyform.nocodec7.disabled=fal se;" />No, because:
<input type="text" name="reason7" disabled />
</fieldset>

Now, in this example the text field is Disabled by default, if the
option "No" is selected this field gets activated.
If any of the other options are selected it will Disable the text field
again.
Although this is perfectly working I'm interested to know if it isn't
just possible to execute some piece of code as soon as option "No"
becomes deselected.

Age Bosma



All times are GMT. The time now is 03:58 PM.

Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57