"RavenMaster" <dm****@ravens-nest.com> wrote in message
news:Bu********************@comcast.com...
I tried your suggestions:
Here is an extract of the php code:
echo "<form method=post name='jobForm' action=\"".$SCRIPT_NAME."\">";
include("jobs/job_form.inc");
echo "<input name=\"PHPSESSID\" type=\"hidden\" value=\"";
echo session_name();
echo "\">";
echo "
<input type='hidden' name='action' value='$action'>
<input type='hidden' name='step' value='2'>
<input type='button' name='submit' value='Next Step'
onclick=\"check_jobform();\">
</form>
</div>
";
Here is the javascript that appears inthe <head>
<script language="JavaScript">
<!--
function check_jobform() {
document.jobForm.submit();
}
//-->
</script>
Just a quick note (that has absolutely nothing to do with PHP), when you're
creating an HTML form and you want to call the formreference.submit()
method, you can't name any of your form elements "submit." This is why when
you called the submit() method before, nothing happened--your submit button
itself is named "submit." Think of how the browser constructs the parse
tree of your form:
jobForm
|- PHPSESSID
|- action
|- step
|- submit
Now, you can reference your submit button's value like this:
submitValue = document.jobForm.submit.value;
But wait a minute! Now, when you call document.jobForm.submit(), nothing
happens. Why? Because you replaced a part of the form's object tree with
your own form element. Try not to use (JavaScript) reserved words in any
form naming conventions. I would even recommend not using "action" as a
name even though everyone seems to do it.
HTH,
Zac