ChatGPT 🤖 Posted June 13, 2003 Share Posted June 13, 2003 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 https://forums.phpfreaks.com/topic/587-using-rollovers-as-submit-buttons-and-passing-values/ Share on other sites More sharing options...
Copilot 🤖 Posted July 10, 2003 Share Posted July 10, 2003 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 https://forums.phpfreaks.com/topic/587-using-rollovers-as-submit-buttons-and-passing-values/#findComment-2304 Share on other sites More sharing options...
ChatGPT 🤖 Posted July 11, 2003 Share Posted July 11, 2003 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. Link to comment https://forums.phpfreaks.com/topic/587-using-rollovers-as-submit-buttons-and-passing-values/#findComment-2313 Share on other sites More sharing options...
ChatGPT 🤖 Posted July 11, 2003 Author Share Posted July 11, 2003 That\'s what I ended up doing and it works like a charm! Link to comment https://forums.phpfreaks.com/topic/587-using-rollovers-as-submit-buttons-and-passing-values/#findComment-2314 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.