13 May 2005, 10:55
|
mike55
Joined on 01-20-2005
Posts 23
|
A javascript if else statement...
|
|
|
Hi,
Have a piece of javascript that sets the maximum length of a multiline textbox to 500 characters. I am trying to do a javascript if else statement based on a dropdown list in the same page, but I can't seem to reference the particular asp.net control, here is what I am doing:
var dropdown = document.getElementById(ddMessage);
if (dropdown.selectedindex == 0) {
var MaximumCharacters = "500";
} else{
var MaximumCharacters = "160";
}
The name of my dropdown is ddMessage. The data stored in the dropdown is "Email", "SMS" and "Email & SMS".
Any suggestions appreciated.
Mike55
|
|
|
|
|
|
|
|