|
-
Jun 22nd, 2001, 03:48 PM
#1
Thread Starter
Lively Member
JavaScript/Submit Button ?
This is probably pretty easy, but I am newbie, so here goes.
How do you check a condition with javascript before a form is submitted using a submit button?
I need to make sure my users have picked an item from a dropdown box, before they go on to the next page. I've having my submit button call a function, but it seems to ignore it.
<SCRIPT language=javascript>
function fncCheckLetter()
{
if(window.formLetterData.cboLetterType.value=="")
{
// User did not select an item from the list.
alert("You must pick a valid item.");
}
}
</SCRIPT>
<INPUT id=btnSubmitLetter name=btnSubmitLetter type=submit value=Submit tabIndex=1 onClick="fncCheckLetter">
Is there a better way or do I have to do something extra with my script?
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
|