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 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php