![]() |
Disabling a text field depending on 2 options
Not 100% sure why or how to make this work.
I have 5 options in a select drop-down. Only two of them are to disable a text field. I have written it successfully to disable on one option. How would I add the second option? I have tried many different ways, and i know its something small that i am missing. Below is the code that does not work but shows the 2 options that disable my text field. Code:
Code:
<tr> |
The || separates statements, not values. Do this instead:
Code:
if(qr_type.value == 'bio' || qr_type.value == 'rebrand') |
If only i got paid for my "brain farts"! thanks.
|
var qr_type = document.getElementById('qr_type');
Just a comment, be aware that in Internet Explorer, names and IDs are global variables and thus you should NEVER use a global variable or function name which is the same as an HTML element name or ID. Here your variables are local, not global scope, but even so it is perhaps unwise or confusing to assign the same name. |
| All times are GMT +1. The time now is 03:32 PM. |
Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.