|
-
January 14th, 2003, 11:42 AM
#1
Determining the validity of a JavaScript parameter
I have a web page that writes a text box to the screen depending on centetain paramters.
if(ok) printf("<input type="text" name="textbox">\n");else printf("Something else");
I then wish to do something IF "textbox" is displayed. I do not then know the state of "ok" so I wish to interrogate textbox to see if it exists.
I there any way to do this in JavaScript?
TIA
-
January 14th, 2003, 01:36 PM
#2
<script language="JavaScript" type="text/javascript">
if (document.yourformname.textbox) {
// the text field is present
} else {
// the text field is not present
}
-
January 15th, 2003, 05:09 AM
#3
Originally posted by websmith99
<script language="JavaScript" type="text/javascript">
if (document.yourformname.textbox) {
// the text field is present
} else {
// the text field is not present
}
Thanks. Doh! How easy!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|