Forum Moderators: open
Here's the code to see what I mean:
<html>
<head>
<script>
function checkit() {
location.href=("http://195.66.240.211/cgi-bin/whois.cgi?query=" + document.check.domain.value);
}
</script>
</head>
<body>
<form name="check">
<input type="text" name="domain">
<input type="button" value="Check It" onClick="checkit()">
</form>
</body>
</html>
(The IP is NIC UK's whois server)
Sloppy I know, but you get the point. Anyway, type in a domain to whois and click the button and it works just fine. However, pressing [enter] just appends "?domain=DOMAIN.EXTENSION" to the current href. Has anyone else come across this, and is it easily fixable?
j4.
My first post, Woo!
<form name="check" action="http://195.66.240.211/cgi-bin/whois.cgi">
<input type="text" name="query">
<input type="submit" value="Check It">
</form>
The action has the filename, the text input has the variable name(s) required as parameters and the submit tells the browser to submit the form when clicked (even if javascript is off).
Really, you should have a method="..." where ... is Post or Get, but most browsers do not need this.