
Solid, safe website tools.
Whatever your need, Will Bontrager builds powerful software solutions.
|
(Get Attention Ticker for your web site)
Form Info Attached To 'Thank You' Page URLBy Will Bontrager Although this is a response to a specific requirement related to specific software, the solution can be applied to pretty much any situation where information provided on a form is to be included in the value of another form field before the form is submitted. In this instance, the web site owner is offering an incentive in exchange for recommending his web site. The incentive is provided by someone else, and they need the visitor's browser redirected to their site with the gift recipient's email address as a URL parameter. Master Recommend Pro V4 is the software being used. The solution is to use JavaScript to append the email address provided on the form to the redirect URL (which, in this case, is the value of a hidden field name="next"). This is the JavaScript that solved that solved the problem: The JavaScript appends the email address to the value already existing in the form field (an incomplete URL, in this case). To use the JavaScript in other situations, change the form name and field names to your own requirements. Alternatively, your JavaScript might replace the entire value of a form field instead of appending to the existing value. The JavaScript function is called after the user clicks the submit button and before the information is actually submitted. A value of "true" is returned to tell the browser to go ahead and submit the information. The JavaScript function is called with an onsubmit attribute in the <form... tag: For completeness, the above includes the hidden field the JavaScript modifies and the text field the email address is copied from. If the visitor provides email address name@example.com, s/he is redirected to http://example.com/free.php?email=name@example.com March 20, 2006 Please note: Articles on this website are presented "as is". However - If you have a question about a CGI script, HTML, CSS, PHP, or JavaScript
Rate this blog post.
No page reload! |
|
|
© 1998-2001 William and Mari Bontrager |
|