Home Articles FAQs XREF Games Software Instant Books BBS About FOLDOC RFCs Feedback Sitemap
irt.Org
#

Q68 How do I change the forms action property?

You are here: irt.org | FAQ | JavaScript | Form | 7.2 | Q68 [ previous next ]

For Netscape 3+:

<script language="JavaScript"><!--
var version = parseInt(navigator.appVersion);
var browser = navigator.appName.indexOf("Microsoft") + 1;

function sendForm() {
    if ((browser == "0") && (version >= "3")) {
        document.registerForm.encoding = 'text/plain';
        document.registerForm.action = 'mailto:someone@somewhere.com';
    }
    return true;
}
//--></script>

<form
  name="registerForm"
  method="post"
  action="/cgi-bin/userform.cgi"
  onSubmit="return sendForm()">
<input type="text" value="some text">
<input type="submit" value="Submit">
</form>

©2018 Martin Webb