hi ,
i'm developing an online application.
and i'm using a same page for adding a new record and then to edit also.
i'm intended to get the data from the table using the id from the page..
but there error shows that document.add has no properties..
the page will add.php for adding and add.php?edit="yes"&id=5 for editing the record with id 5..Code:<script language=javascript src="js/addrole.js"></script> <script language=javascript>document.onload(loadentries());</script> <?php $function = $_POST['function']; $rname = $_POST['role']; $per = $_POST['grpper']; $id = $_GET['id']; $edit = $_GET['edit']; ?> <center> <table align=center width=100% border=0> <form name="add" method=POST action="<?php echo $PHP_SELF;?>" onSubmit= "return check()"> <input name="function" type=hidden value="change"> <input name="grpper" type=hidden value="<?php echo $per;?>"> <tr><td>Enter Role Name </td><td><input type=text name='name' value='<?php echo "$rname"; ?>'></td></tr> <tr height=20><td></td></tr> <tr><td colspan=3> <table frame=box rules=rows border=1 width=100%> <tr><td><b>Select </b></td><td class=cjust><b>View Only</b></td><td class=cjust><b>Create/Edit/Delete</b></td></tr> <tr><td>permission</td><td class=cjust><input type=checkbox name=chk1 value=1></td><td class=cjust><input type=checkbox name=chk2 value=2></td></tr> <tr><td>permission1</td><td class=cjust><input type=checkbox name=chk3 value=3></td><td class=cjust><input type=checkbox name=chk4 value=4></td></tr> . . . . <tr><td>permission9</td><td class=cjust></td><td class=cjust><input type=checkbox name=chk15 value=15</td></tr> </table> </td></tr> <tr><td colspan=4 class=rjust><input class="frmbtn" type=button name=add value="Select All" onClick="selall()"></td></tr> <tr height=35 align=center><td><input class="frmbtn" type=submit name=add value="Add"></td> <td><input class="frmbtn" type=reset value="Cancel"></td> </tr> </form> </table> <?php } ?>
the javascript code
what's the error with this function .??Code:function loadentries() { alert ("entered"); alert ("document.add.grpper.value"); }
pls help me




Bookmarks