php - Form not posting by getElementById -
i having trouble posting form generated php echo below. getelementbyid function not seem work
<?php include 'connect.php' ; $sql=mysql_query("select mess_id,receiver,subject messages order last_update asc"); while($row = mysql_fetch_array($sql)) { echo "<form id='newmsg' action='inbox.php' enctype='multipart/form-data' method='post'> <li class='message-menu'> <span class='message-status'> <a href='javascript:void(0)' class='starred' title='starred'>starred</a> <a href='javascript:void(0)' class='new-message' title='mark read'>new</a> </span> <span class='message-info'> <span class='blue'>17:12</span> <a href='javascript:void(0)' class='attach' title='download attachment'>attachment</a> </span> <input type='hidden' name='mess1' value='yes' /> <input type='hidden' name='mess_id' value='" . $row['mess_id'] . "' /> <a href='#' onclick='document.getelementbyid('newmsg').submit();' title='read message' >"; echo "<strong class='blue'>" . $row['receiver'] . "</strong><br> <span class='message-status'></span> <span class='message-status'> </span> <span class='message-info'></span>"; echo "<strong >" . $row['subject'] . "</strong> </a> </li></form>";}?>
try this
<a href='#' onclick='document.getelementbyid('newmsg').submit();' title='read message' >
change into
<a href='#' onclick='document.getelementbyid(\"newmsg\").submit();' title='read message' >
Comments
Post a Comment