|
-
May 27th, 2003, 10:19 AM
#1
Thread Starter
Hyperactive Member
Java script
Hello, I am trying to write a small piece of javascript , and it aint going to plan.
Its on an ASP page,
<script language="JavaScript" type="text/javascript">
var frmvalidator = new Validator("mainform");
if (form1.select1 contains the letter X) then
frmvalidator.addValidation("select1")
</script>
--where form1 is the form name and select1 is a menu/list box.
I basically want to use the addValidation function only when a certain condition is met , that the menu/list box value selected contains an X.
For anyone can understand what i'm trying to say , if you have a knowledge of javascript and an idea of how to solve this problem,
please let me know,
THanks
-
May 28th, 2003, 01:33 AM
#2
You can get the value of the currently selected option with this line (sel is the select box):
sel.options[sel.selectedIndex].value
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
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
|