Jump to content


Photo

Different actions 2 buttons.


  • Please log in to reply
4 replies to this topic

#1 cameeob2003

cameeob2003
  • Members
  • PipPipPip
  • Advanced Member
  • 79 posts

Posted 17 August 2006 - 12:02 AM

I have the following 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>

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?

#2 Corona4456

Corona4456
  • Members
  • PipPipPip
  • Advanced Member
  • 244 posts
  • LocationEl Paso, TX

Posted 17 August 2006 - 12:10 AM

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.
What is the CoronaMatrix?

#3 cameeob2003

cameeob2003
  • Members
  • PipPipPip
  • Advanced Member
  • 79 posts

Posted 17 August 2006 - 08:43 PM

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

#4 Daniel0

Daniel0
  • Staff Alumni
  • Advanced Member
  • 11,956 posts

Posted 19 August 2006 - 09:48 AM

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


#5 Corona4456

Corona4456
  • Members
  • PipPipPip
  • Advanced Member
  • 244 posts
  • LocationEl Paso, TX

Posted 21 August 2006 - 11:52 PM

Using php you can easily redirect.  In your php code just check to see what button was set in your $_POST variables.

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

What is the CoronaMatrix?




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users