HGeneAnthony Posted April 21, 2007 Share Posted April 21, 2007 I was wondering if it's possible for me to create a form where the user can submit the form by clicking on a hyperlink instead of clicking on a button to pass the data. Is this possible? Link to comment https://forums.phpfreaks.com/topic/48066-is-there-a-way-to-pass-a-form-by-clicking-on-a-link/ Share on other sites More sharing options...
Psycho Posted April 21, 2007 Share Posted April 21, 2007 Yes, you need to use javascript to do that Example: <a href="#" onclick="document.FORMNAME.submit();">Submit Form</a> Link to comment https://forums.phpfreaks.com/topic/48066-is-there-a-way-to-pass-a-form-by-clicking-on-a-link/#findComment-234920 Share on other sites More sharing options...
HGeneAnthony Posted April 21, 2007 Author Share Posted April 21, 2007 Thanx for the tip. I'm always apprehensive though of using client-side scripting for anything that can break functionality. If someone doesn't enable JavaScript the page won't work. Question though, does Flash use JavaScript to run or is it considered something else? Link to comment https://forums.phpfreaks.com/topic/48066-is-there-a-way-to-pass-a-form-by-clicking-on-a-link/#findComment-234928 Share on other sites More sharing options...
fert Posted April 21, 2007 Share Posted April 21, 2007 Flash uses ActionScript Link to comment https://forums.phpfreaks.com/topic/48066-is-there-a-way-to-pass-a-form-by-clicking-on-a-link/#findComment-234929 Share on other sites More sharing options...
Psycho Posted April 21, 2007 Share Posted April 21, 2007 And Flash is client-side as well. So, which is more prevalent: javascript or flash? Javascript is built in and enabled by default; flash requires the user to install it. There is no way to submit a form through a hyperlink without client-side code that I know of. Why does it have to be a link and not a button? Is it only for aesthetic reasons? If that is the case you can simply style the button to look like a link. Link to comment https://forums.phpfreaks.com/topic/48066-is-there-a-way-to-pass-a-form-by-clicking-on-a-link/#findComment-234932 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.