Jump to content

Archived

This topic is now archived and is closed to further replies.

cameeob2003

Different actions 2 buttons.

Recommended Posts

I have the following code:

[code]<table width="13" border="0" cellpadding="0" cellspacing="0">
                      <tr>
                        <td width="13"><img src="images/index_15.gif" width="45" height="17" alt=""></td>
<td><input type="text" name="email" value="" style="background:url(images/index_16.gif); width:137px; height:13px; border:none; font-size:9px;" /></td>
<td><img src="images/index_17.gif" width="17" height="17" alt=""></td>
                      </tr>
                    </table></td>
                </tr>
                <tr>
                  <td><table width="194" border="0" cellpadding="0" cellspacing="0">
                      <tr>
                        <td width="185"><img src="images/index_18.gif" width="201" height="5" alt=""></td>
                      </tr>
                    </table></td>
                </tr>
                <tr>
                  <td><table width="188" border="0" cellpadding="0" cellspacing="0">
                      <tr>
                        <td width="44"><img src="images/index_19.gif" width="50" height="16" alt=""></td>
                        <td width="136"><input type="submit" name="subscribe" value="" style="background:url(images/index_20.gif); width:58px; height:16px; border:none;" /></td>
                        <td width="10"><img src="images/index_21.gif" width="7" height="16" alt=""></td>
                        <td width="17"><input type="submit" name="unsubscribe" value="" style="background:url(images/index_22.gif); width:66px; height:16px; border:none;" /></td>
<td><img src="images/index_23.gif" width="20" height="16" alt=""></td>
                     
                    </table>[/code]

I want the three <input> areas to be in one form with 2 different options our outputs depending on the button you click. Is this possible it seems doable but is it?

Share this post


Link to post
Share on other sites
Yes it is possible to do.  There are different ways to do it depending on what action you want to happen when either or is clicked.  You can use Javascript to handle client side changes on the page or php if it requires the server to handle the submission of the form.

Share this post


Link to post
Share on other sites
How would i go about doing this. I have 2 diffent pages I want to redirect the user to depending on what they click.

Share this post


Link to post
Share on other sites
This will not solve your problem, but instead of using: [code]<input type="submit" name="unsubscribe" value="" style="background:url(images/index_22.gif); width:66px; height:16px; border:none;" />[/code] I think you should use: [code]<button type='submit' name='unsubscribe'><img src='images/index_22.gif' alt='unsubscribe'></button>[/code]

Share this post


Link to post
Share on other sites
Using php you can easily redirect.  In your php code just check to see what button was set in your $_POST variables.

[code]
if($_POST['buttonname1']){
  header("Location: redirect1.html");
}
else if($_POST['buttonname2']){
  header("Location: redirect2.html");
}
[/code]

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.