posting form values doesn't work
| From: | �ystein H�land | Date: | Sat, 31 Aug 2002 18:52:00 +0000 |
| Subject: | posting form values doesn't work | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-114779@lists.php.net to get a copy of this message | ||
This is my form:
<FORM NAME="answerform" METHOD=POST>
Your name:<BR><INPUT TYPE=TEXT NAME="name" SIZE=20>
Group:<BR><INPUT TYPE=TEXT NAME="group" SIZE=8>
<INPUT TYPE=BUTTON VALUE=" OK!" onClick="Javascript:validate(this);">
</FORM>
and the function validate:
function validate() {
var ok=true;
if (document.answerform.name.value=='') {
ok=false;
alert('Please write Your name')
document.answerform.name.focus();
document.answerform.name.select();
}
if (document.answerform.group.value=='') {
ok=false;
alert('What group?')
document.answerform.group.focus();
document.answerform.group.select();
}
if (ok==true) {
location.href='groups/collect_answer.php?name=<?php echo $name;
?>&group=<?php echo $group; ?>';
return true;
} else { return false; }
}
and this doesn't work and I can't see why not