php - Two Forms, One Button. Not sure of how to make this happen -
i have page prints out rows of information. in each row notes box:
<?php <td style='font-size:12px;width:300px;'> {$row['notes']} <br /><center><br /> <form action=\"http://********/functions/notes.php\" id='formnotesform' method='post'> <input type='hidden' id='id' name='id' value='{$row['id']}' /> <textarea placeholder=\"add more notes here...\" name=\"notes\" rows=\"5\" cols=\"30\"'></textarea><br /> <input type='submit' name='formnotes' id='formnotes' value='add notes' /> </form> </center></td> ?> then there's button on page in each row.
<form action=\"http://********/functions/archive.php\" method='post' id='formarchiveform' onclick=\"return checkarchive()\"> <input type='hidden' id='id' name='id' value='{$row['id']}' /> <input type='submit' name='formarchive' id='formarchive' value='archive' style=\"height:25px; width:80px\"/> </form> what need happen when clicks "add notes" button job when clicks "archive" button checks see if notes empty , if not submits (kind of failsafe).
ideally i'd pick notes data , post archived.php file form going anyways since cause minimal disruption code base can't work.
i understand isn't sensible choice. has done. help!
if had reputation ask first because understood want button has been pressed things.
if that's this:
if($_server['request_method'] == 'post') { if(isset($_post['formnotes'])) { //... } elseif(isset($_post['formarchive'])) { //... } }
Comments
Post a Comment