View Single Post
Old 06-27-2012, 01:55 PM   PM User | #1
brood_snow
New to the CF scene

 
Join Date: Jun 2012
Posts: 5
Thanks: 0
Thanked 1 Time in 1 Post
brood_snow is an unknown quantity at this point
HTML form question

Code:
<html>
		<head>
		<title>Student to search into database</title>

         <script language="javascript">
			function validate2(objForm){
				
				int k = 0;
				if(objForm.name.value.length==0){
					objForm.name.focus();
					k++;
				}
				
				if(objForm.year.value.length==0){
					objForm.year.focus();
					k++;
				}

				if(objForm.id.value.length==0){
					objForm.year.focus();
                    k++;
				}
				
				if(k == 0){
				   return false;
				}
			return true;
			}
          </script>
          
        </head>
		<body bgcolor=#ADD8E6><center>
		
		<form action="FoundStudents.jsp" method="post" name="entry" onSubmit="validate(this)">
		
		<input type="hidden" value="list" name="seek_stud">
		<table border="1" cellpadding="5" cellspacing="5" bgcolor = #333366>
			<tr>
				<td>
					<table>
						<tr><td colspan="2" align="center"><h2><font color= #FFFF66>Please insert student data</font></h2></td></tr>
						<tr><td colspan="2">&nbsp;</td></tr>
						<tr><td><font color= #FFFF66>Name:</font></td><td><input name="name" type="text" size="50"></td></tr>
						<tr><td><font color= #FFFF66>Year:</td><td><input name="year" type="text" size="50"></td></tr>
						<tr><td><font color= #FFFF66>ID:</td><td><input name="id" type="text" size="10"></td></tr>
						<tr><td colspan="2" align="center"><input  name= "submit_seek_stud" type="submit" value="Submit"></td></tr>
					</table>
				</td>
			</tr>
		</table>
		</form>
		</body>
  </html>
The form works only with the
Code:
<input type="hidden" value="list" name="seek_stud">
. Could someone please explain me why is this line necessary(what does it actually do)? Because I found on Google that hidden is used only when you submit some information(not visible to the user) in addition to what the user types, and I am not sending such additional information.

Thank you in advance!
brood_snow is offline   Reply With Quote