Page 1 of 1

adding two functions to one button

Posted: Tue Sep 11, 2012 4:40 am
by jonnyfortis
I have a form that has one submit button and one tick box.

submit button sends you to a new page (a lease)

currently if the tick box is not selected and you click the submit button it give an alert to say that you must tick the box to view the lease.

I need it that once you have ticked the box and submit it stores this information in a php sysql database ( i have set up already) and directs you to the lease

here is what i have already

Code: Select all

<form action="section21.php?userid=<?php echo $row_Recordset1['userid']; ?>" method="post" name="form4" target="_new" id="form4">
        <div align="right"><span id="sprycheckbox4">
          <span class="body-text">Section 21 Notice</span><br />
          <input type="image" src="../images/smalldownload.png" width="35" height="35" alt="download" value="submit"/>
          </a>
          <input type="checkbox" name="21notice" id="21notice" />
        </span></div>
        <span id="sprycheckbox4">
        <label for="21notice2"></label>
        <div align="right"><br />
        </div>
        </span>
      </form>

<div id="ErrorZone2"><span class="checkboxRequiredMsg"><table width="400" border="1" cellspacing="0" cellpadding="0">
        <tr>
          <td><table width="400" border="0" cellspacing="10" cellpadding="0">
            <tr>
              <td><strong>Electronic Signature Agreement:</strong><br /></td>
              </tr>
            <tr>
              <td>Tenant (<?php echo $row_Recordset1['userid']; ?>) and Guarantor (<?php echo $row_Recordset1['GuName']; ?>) usernames <?php echo $row_Recordset1['userid']; ?></td>
              </tr>
            </table></td>
          </tr>
  </table>
</span></div><script type="text/javascript">
var sprycheckbox4 = new Spry.Widget.ValidationCheckbox("sprycheckbox4", {additionalError: 'ErrorZone2'});
</script>

Re: adding two functions to one button

Posted: Tue Sep 11, 2012 2:14 pm
by requinix
You can use header to redirect to another page. See the documentation for an example.

Re: adding two functions to one button

Posted: Wed Sep 12, 2012 5:46 am
by jonnyfortis
ok thanks will have a look at that


thanks again