Jump to content

Using Rollovers As 'Submit' Buttons And Passing Values?


Recommended Posts

First off, sorry for the crosspost, but I wasn\'t sure which one to put this in. I\'m using Dreamweaver but the function is Javascript.

 

Since starting to use DW (6.1) - I\'ve been changing my Form Submit buttons into Graphic Rollovers and they work great if I need to go from page to page:

 

<form name=\"activatedok\" method=\"post\" action=\"index.php\">

<a onmouseout=\"MM_swapImgRestore()\" onmouseover=\"MM_swapImage(\'Image1\',\'\',\'./images/button-sdragon.gif\',1)\"><img name=\"Image1\" border=\"0\" src=\"./images/button-return.gif\" onclick=\"document.activatedok.submit()\"></a>

</form>

 

Now I\'ve come to a point that I need to actually PASS a variable to another php file like a normal Submit button but I can\'t figure out how to do it. :/ The statement that would need to pass would be:

 

<form name=\"purchase_guide\" method=\"post\" action=\"purchase.php\">

<font color=\"#FFFFFF\" size=\"3\" face=\"Times New Roman, Times, serif\"><strong><em>Only 1 Allowed Per Game</em></strong></font><br>

<a onmouseout=\"MM_swapImgRestore()\" onmouseover=\"MM_swapImage(\'Image6\',\'\',\'./images/button-sdragon.gif\',1)\"><img name=\"Image6\" border=\"0\" src=\"./images/button-buy.gif\" onclick=\"document.purchase_guide.submit()\"></a>

</form>

 

And I would need to pass (to \'purchase.php\') the values of:

 

value=\"Buy Guide\" name=\"buyitem\"

 

How would I do this?

 

Thanks! :)

Link to comment
Share on other sites

  • 4 weeks later...

hi,

 

well, i think so, you\'d use some like this...

 

<form name=\"purchase_guide\" method=\"post\" action=\"purchase.php?value=\'Buy Guide\'&name=buyitem>

<font color=\"#FFFFFF\" size=\"3\" face=\"Times New Roman, Times, serif\"><strong><em>Only 1 Allowed Per Game</em></strong></font><br>

<a onMouseOut=\"MM_swapImgRestore()\" onMouseOver=\"MM_swapImage(\'Image6\',\'\',\'./images/button-sdragon.gif\',1)\"><img name=\"Image6\" border=\"0\" src=\"./images/button-buy.gif\" onClick=\"document.purchase_guide.submit()\"></a>

</form>

 

Change this line... in action=\"purchase.php?value=\"buy guide\"&namebuyitem

 

Like this...

 

<form name=\"purchase_guide\" method=\"post\" action=\"purchase.php?value=\'Buy Guide\'&name=buyitem>

 

and test it...

 

remember retrive whit $value= $_GET[\'value\']; or $value= $_REQUEST[\'algo\']; in purchase.php idem for name

 

i hope that work correctly :)

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.