Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 01-14-2004, 03:51 PM   PM User | #1
mrsocks
New to the CF scene

 
Join Date: Jan 2004
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
mrsocks is an unknown quantity at this point
need help with 3 forms and onsubmits

hello,

i have a page that has three forms on it. i want to validate that there has been a valid choice made for the choice they have made (ex: if in the category list, they choose one of the final categories.

the keyword feild works fine, but neither of the drop downs work.
here is the code:

###########################
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=ISO-8859-1">
<title>test js page</title>

<link rel="stylesheet" href="../st_ss.css">

<script language="javascript" type="text/javascript">
function onlinejumpMenuBRANDS()
{
if (document.searchBRANDS.brands.value == 0)
{
alert ('You must choose a Brand');
return false;
}
return true;
}

function onlinejumpMenuKWORD()
{
if (document.searchKEY.keyword.value == "")
{
alert ('You must enter something');
return false;
}
return true;
}

function onlinejumpMenuCAT()
{
if (document.searchCAT.id3.value == 0)
{
alert ('You must choose a Category');
return false;
}
return true;
}


</script>

</head>
<body class="mainbgcolor1" leftmargin="0" marginwidth="0" topmargin="0" marginheight="0">

<BR><BR><BR>

<form method="get" action="page.php" name="searchBRANDS" onSubmit="return onlinejumpMenuBRANDS()">
<select name="brands" onChange="this.form.submit()">
<option value="0">Brand</option>
<option value="0">BLANK</option>
<option value="test1">TEST 1</option>
<option value="test2">TEST 2</option>
<option value="test3">TEST 3</option>
</select>
</form>

<BR><BR><BR>

<form method="get" action="page.php" name="searchCAT" onSubmit="return onlinejumpMenuCAT()">

<select name="id3" onChange="this.form.submit()">
<option value="0">Category</option>
<option value="0">&nbsp;</option>

<option value="0">:: MAIN CAT</option>\n";
<option value="0">---------------------</option>

<option value="0">&gt;&nbsp; Sub Cat</option>

<option value="3">&nbsp;&nbsp;&nbsp;&nbsp; final category</option>

<option value="0">&nbsp;</option>

<option value="0">&nbsp;</option>

</select>
<input type="hidden" name="pg" value="show">
</form>

<BR><BR><BR>

<form method="get" action="page.php" name="searchKEY" onSubmit="return onlinejumpMenuKWORD()">
<input type="text" name="keyword" size="10">
<input type="image" name="submit" src="../images/header2_11.gif" width="33" height="18" border="0" align="top">
<input type="hidden" name="pg" value="show">
</form>


</body>
</html>

########################


thanks
mrsocks is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 03:51 PM.


Advertisement
Log in to turn off these ads.