/    Sign up×
Community /Pin to ProfileBookmark

[RESOLVED] Help with a small JS code

I have a small JS code that submit the form.

[FONT=”Courier New”][SIZE=”1″]<html>
<head>
<title>test</title>
<script language=”javascript”>
function validate() {
document.myform.submit();
}
</script>
</head>
<body>
<?php
$Fname = $_POST[“Fname”];
$Lname = $_
POST[“Lname”];
$Title = $_GET[“title”];
echo “$Title $Fname $Lname <p>”;
?>
<form method=”post” name=”myform” action=”<?php echo $PHP_SELF . “?title=Mr.”;?>”>
First Name:<input type=”text” size=”12″ maxlength=”12″ name=”Fname”><br />
Last Name:<input type=”text” size=”12″ maxlength=”36″ name=”Lname”><br />
<input type=”submit” value=”submit” name=”submit”>
<a href=”javascript:validate();”>Submit</a>
</form></body>
</html>
[/SIZE]
[/FONT]

When I click the Submit link, FireFox tells me that document.myform.submit(); is not a function. What did I do wrong?

to post a comment
JavaScript

1 Comments(s)

×

Success!

Help @netman00 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...