girlzz Posted August 11, 2008 Share Posted August 11, 2008 hello sir... can anybody help me?? i make form that has 3 buttons..submit,reset and delete.... my problem is.. my reset button doesn't work.. why?? but if i enter delete button the whole page will be return to default... how to make my reset button return to default not the delete button..anyone can help me please...?? :'( :'( <input name="saved" type="submit" class="style28" id="saved" value="Save" /> <input name="reset" type="reset" class="style28" id="reset" value="Reset" /> <input name="button" type="submit" class="style28" id="button" onClick="return confirm('Are you sure you wish to delete the selected rows?')" value="Delete" /> Link to comment https://forums.phpfreaks.com/topic/119092-reset-button/ Share on other sites More sharing options...
secoxxx Posted August 11, 2008 Share Posted August 11, 2008 can you post the entire form code... Link to comment https://forums.phpfreaks.com/topic/119092-reset-button/#findComment-613204 Share on other sites More sharing options...
girlzz Posted August 11, 2008 Author Share Posted August 11, 2008 <form name="form1" method="post" action="" > <table width="500" border="1"> <tr> <td height="33" colspan="4"><div align="center" class="style24">Medic Assessment System</div></td> </tr> <tr> <td height="26" colspan="4"><div align="center" class="style25"> Group Registration</div></td> </tr> <tr> <td width="99" class="style1"><div align="right" class="style3 style19"><strong>Year </strong>:</div></td> <td width="128" class="style1"> <div align="left"> <select name="year" id="year" onChange="MM_jumpMenu('parent',this,0)"> <option value="#">Please select</option> <option value="?value=1 block 1&group=<? echo $_GET['group'] ?>" <?php if($_GET['value']=='1 block 1'){echo"selected=\"selected\"";} ?>>1 block 1</option> <option value="?value=1 block 2&group=<? echo $_GET['group'] ?>" <?php if($_GET['value']=='1 block 2'){echo"selected=\"selected\"";} ?>>1 block 2</option> <option value="?value=1 block 3&group=<? echo $_GET['group'] ?>" <?php if($_GET['value']=='1 block 3'){echo"selected=\"selected\"";} ?>>1 block 3</option> <option value="?value=1 block 4&group=<? echo $_GET['group'] ?>" <?php if($_GET['value']=='1 block 4'){echo"selected=\"selected\"";} ?>>1 block 4</option> <option value=" "> </option> <option value="?value=2 block 1&group=<? echo $_GET['group'] ?>" <?php if($_GET['value']=='2 block 1'){echo"selected=\"selected\"";} ?>>2 block 1</option> <option value="?value=2 block 2&group=<? echo $_GET['group'] ?>" <?php if($_GET['value']=='2 block 2'){echo"selected=\"selected\"";} ?>>2 block 2</option> <option value="?value=2 block 3&group=<? echo $_GET['group'] ?>" <?php if($_GET['value']=='2 block 3'){echo"selected=\"selected\"";} ?>>2 block 3</option> <option value="?value=2 block 4&group=<? echo $_GET['group'] ?>" <?php if($_GET['value']=='2 block 4'){echo"selected=\"selected\"";} ?>>2 block 4</option> <option value=" "> </option> <option value="?value=3 block 1&group=<? echo $_GET['group'] ?>" <?php if($_GET['value']=='3 block 1'){echo"selected=\"selected\"";} ?>>3 block 1</option> <option value="?value=3 block 2&group=<? echo $_GET['group'] ?>" <?php if($_GET['value']=='3 block 2'){echo"selected=\"selected\"";} ?>>3 block 2</option> <option value="?value=3 block 3&group=<? echo $_GET['group'] ?>" <?php if($_GET['value']=='3 block 3'){echo"selected=\"selected\"";} ?>>3 block 3</option> <option value="?value=3 block 4&group=<? echo $_GET['group'] ?>" <?php if($_GET['value']=='3 block 4'){echo"selected=\"selected\"";} ?>>3 block 4</option> <option value=" "> </option> <option value="?value=4 block 1&group=<? echo $_GET['group'] ?>" <?php if($_GET['value']=='4 block 1'){echo"selected=\"selected\"";} ?>>4 block 1</option> <option value="?value=4 block 2&group=<? echo $_GET['group'] ?>" <?php if($_GET['value']=='4 block 2'){echo"selected=\"selected\"";} ?>>4 block 2</option> <option value="?value=4 block 3&group=<? echo $_GET['group'] ?>" <?php if($_GET['value']=='4 block 3'){echo"selected=\"selected\"";} ?>>4 block 3</option> <option value="?value=4 block 4&group=<? echo $_GET['group'] ?>" <?php if($_GET['value']=='4 block 4'){echo"selected=\"selected\"";} ?>>4 block 4</option> </select> </div></td> <td width="89" class="style1"><div align="right" class="style3"><span class="style27">Session </span>:</div></td> <td width="156" class="style1"><div align="left" class="style3"> <label> <input name="sessi" type="text" id="sessi" size="15" maxlength="15" value="2007/2008"/> </label> </div></td> </tr> <tr> <td class="style1"><div align="right" class="style3"><span class="style27">PBL Group</span> :</div></td> <td class="style1"><div align="left" class="style3"> <label> <select name="group" size="1" id="group" onChange="MM_jumpMenu('parent',this,0)"> <option value="#">Please select</option> <option value="?value=<? echo $_GET['value']?>&group=1" <?php if($_GET['group']=='1'){echo "selected=\"selected\"";} ?>>1</option> <option value="?value=<? echo $_GET['value']?>&group=2" <?php if($_GET['group']=='2'){echo "selected=\"selected\"";} ?>>2</option> <option value="?value=<? echo $_GET['value']?>&group=3" <?php if($_GET['group']=='3'){echo "selected=\"selected\"";} ?>>3</option> <option value="?value=<? echo $_GET['value']?>&group=4" <?php if($_GET['group']=='4'){echo "selected=\"selected\"";} ?>>4</option> <option value="?value=<? echo $_GET['value']?>&group=5" <?php if($_GET['group']=='5'){echo "selected=\"selected\"";} ?>>5</option> <option value="?value=<? echo $_GET['value']?>&group=6" <?php if($_GET['group']=='6'){echo "selected=\"selected\"";} ?>>6</option> <option value="?value=<? echo $_GET['value']?>&group=7" <?php if($_GET['group']=='7'){echo "selected=\"selected\"";} ?>>7</option> <option value="?value=<? echo $_GET['value']?>&group=8" <?php if($_GET['group']=='8'){echo "selected=\"selected\"";} ?>>8</option> <option value="?value=<? echo $_GET['value']?>&group=9" <?php if($_GET['group']=='9'){echo "selected=\"selected\"";} ?>>9</option> <option value="?value=<? echo $_GET['value']?>&group=10" <?php if($_GET['group']=='10'){echo "selected=\"selected\"";} ?>>10</option> <option value="?value=<? echo $_GET['value']?>&group=11" <?php if($_GET['group']=='11'){echo "selected=\"selected\"";} ?>>11</option> <option value="?value=<? echo $_GET['value']?>&group=12" <?php if($_GET['group']=='12'){echo "selected=\"selected\"";} ?>>12</option> </select> </label> </div></td> <td class="style1"><div align="right"><span class="style3"></span></div></td> <td class="style1"><div align="left"><span class="style3"></span></div></td> </tr> </table> <p> </p> <table width="416" height="70" border="1"> <tr> <td width="87" height="33"><strong>Matric No</strong> </td> <td width="7"><div align="center">:</div></td> <td width="300"><input name="matric" type="text" class="style28" id="matric" value="<?php echo $row_viewer['matric_no']; ?>" size="15" maxlength="15" /></td> </tr> <tr> <td height="29" bgcolor="#FFFFFF"><strong>Name</strong></td> <td><div align="center">:</div></td> <td><input name="name" type="text" class="style28" id="name" value="<?php echo $row_viewer['name']; ?>" size="50" maxlength="50"/></td> </tr> </table> <blockquote> <blockquote> <p align="center"><input name="saved" type="submit" class="style28" id="saved" value="Save" /> <input name="reset" type="reset" class="style28" id="reset" value="Reset" /> </p> <p align="left"> <input type="hidden" name="MM_insert" value="form1" /> </p> </blockquote> </blockquote> </form> <form name="form2" method="post" action=""> <table width="765" height="60" border="1" bordercolor="#000000"> <tr> <td width="100" height="28" class="style3"><div align="center" class="style28"><strong>Matric_No</strong></div></td> <td width="288" class="style3"><div align="center" class="style28"><strong>Name</strong></div></td> <td width="59" class="style3"><div align="center" class="style28"><strong>Sessi</strong></div></td> <td width="57" class="style3"><div align="center" class="style28"><strong>Year</strong></div></td> <td width="64" class="style3"><div align="center" class="style28"><strong>Group</strong></div></td> <td width="76" class="style3"><div align="center" class="style28"><strong> Status </strong></div></td> <td width="75" class="style3"><div align="center" class="style28"><strong>Delete</strong></div></td> </tr> <?php do { ?> <tr> <td height="24" class="style3 style2 style4"><div align="left" class="style28"><?php echo $row_all['matric_no']; ?></div></td> <td class="style3 style2 style4"><div align="left" class="style28"><?php echo $row_all['name']; ?></div></td> <td class="style3 style2 style4"><div align="center" class="style28"><?php echo $row_all['sessi']; ?></div></td> <td class="style3 style2 style4"><div align="center" class="style28"><?php echo $row_all['year']; ?></div></td> <td class="style3 style2 style4"><div align="center" class="style28"><?php echo $row_all['group']; ?></div></td> <td class="style3 style2 style4"><div align="center" class="style28"><?php echo $row_all['status']; ?></div> <td class="style3 style2 style4"><div align="center"> <input name="del_id[]" type="checkbox" class="style28" value="<?php echo $row_all['matric_no']; ?>" /> <input type = "hidden" name ="cek " value = "<?php echo $row_all['matric_no'];?>" /> </div></td> <?php } while ($row_all = mysql_fetch_assoc($all)); ?></table> <input name="button" type="submit" class="style28" id="button" onClick="return confirm('Are you sure you wish to delete the selected rows?')" value="Delete" /> <input type="hidden" name="value" id="value" value="<? echo $_GET['value'] ?>" /> <input type="hidden" name="group" id="group" value="<? echo $_GET['group'] ?>" /> </form></td> </tr> <tr> <td height="7" valign="bottom" bgcolor="#0099FF"><div align="center"><span class="style6">INDIVIDUAL</span></div></td> </tr> <tr> <td height="16" valign="bottom" bgcolor="#00CCFF"><ul><li><a href="block_reg_try.php">Block Register</a> </li> <li><a href="report_main.php">Reports</a></li> <li>View Data <ul> <li>Class List <ul> <li>By All <ul> <li><a href="class_list.php">Class List</a></li> </ul> </li> <li>By Group <ul> <li><a href="q_class_list.php">q Class List</a></li> </ul> </li> </ul> </li> <li><a href="query_matric.php">By Matrix No</a></li> <li><a href="query_year.php">By Year</a></li> <li><a href="grop.php">By Group</a></li> <li><a href="query_all.php">By All</a> </li> </ul> </li> </ul></td> </tr> <tr> <td height="14" valign="bottom" bgcolor="#0099FF"><div align="center"><span class="style7">PBL GROUP </span></div></td> </tr> <tr> <td height="35" valign="bottom" bgcolor="#00CCFF"><ul> <li>Registration </li> <li>Lecturer List </li> </ul></td> </tr> <tr> <td height="16" valign="bottom" bgcolor="#0099FF"><span class="style7"><a href="login.php">>>LOGOUT</a></span></td> </tr> <tr> <td height="144" valign="bottom" bgcolor="#00CCFF"><p align="center" class="style7">Date: <?php echo date('Y-m-d') ."\n";?></p> </td> </tr> <tr> <td height="58" colspan="2"><table width="100%" height="39" border="0" cellpadding="0" cellspacing="0"> <tr> <td align="center" bgcolor="#00CCFF" class="basestyle">© Copyright . All Rights Reserved. <a href="http://www.myfreetemplates.com" class="basestyle"></a></td> </tr> </table></td> </tr> </table> </body> </html> <?php if ((isset($_POST["name"])) && ($_POST["name"] == "")) { mysql_free_result($viewer); mysql_free_result($all); } ?> Link to comment https://forums.phpfreaks.com/topic/119092-reset-button/#findComment-613245 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.