Jump to content

Archived

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

jhale1966

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! :)

Share this post


Link to post
Share on other sites

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 :)

Share this post


Link to post
Share on other sites

You can\'t do that, sorry.

 

Instead, try using a \"hidden\" field:

<input type="hidden" value="Buy Guide" name="buyitem">

And, also remember register_globals.

 

HTH, LiamG.

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.