/    Sign up×
Community /Pin to ProfileBookmark

Javascript isn’t working

Hi Everyone,

I am not sure why the following code is not stopping the page from processing. Any help would be appreciated.

<script language=”JavaScript” type=”text/javascript”>

function checkform ( detailsform )
{
if (document.detailsform.FirstName.value == “”) {
alert( “Please enter your first name.” );
document.detailsform.FirstName.value();
return false ;

}
</script>

THE FORM:an extract

<form method=”post” name=”detailsform” onSubmit= “checkform(this)”

action=”https://secure1.magic-moments.com.au/homebg/email.cgi“>
<input type=hidden name=”recipient”

value=”seminars@homebaseexpo.com.au”>
<input type=hidden name=”subject” value=”Seminar Enrolment”>
<input type=hidden name=”redirect”

value=”https://secure1.magic-moments.com.au/homebg/thankyou.html“>
<input type=hidden name=”env_report”

value=”REMOTE_HOST,HTTP_USER_AGENT”>

<input type=”hidden” name=”course” value=”$fields{SeminarEmail}”>

<tr>
<td width=8>&nbsp;</td>
<td width=”300″>
<p><font color=”#00549a”><b><font face=”arial, geneva” size=”2″>
<font color=”#FFFFFF”>&nbsp;&nbsp;</font>Course Name:

</font></b></font></p>
</td>
<td width=”300″> <font face=Arial size=2><select name=”Course

Name”>
<option selected

value=”$fields{txtSeminarName}”>$fields{txtSeminarName}</option>
</select>

</font> </td>
<td height=”27″ width=”12″>&nbsp; </td>
</tr>
<tr>
<td width=8>&nbsp;</td>
<td width=”300″>
<p><font color=”#00549a”><b><font face=”arial, geneva” size=”2″>
<font color=”#FFFFFF”>&nbsp;&nbsp;</font>Starting Date:

</font></b></font></p>
</td>
<td width=”300″> <font face=Arial size=2><select

name=”SeminarDate”>
<option selected value=”$fields{txtDateOne}”>$fields{txtDateOne}</option>
<option value=”$fields{txtDateTwo}”>$fields{txtDateTwo}</option>
</select>

</font></td>
<td width=”12″>&nbsp;</td>
</tr>
<tr>
<td width=8 height=”29″>&nbsp;</td>
<td height=”29″ width=”300″><font color=#00549a size=2 face=arial>
&nbsp;&nbsp;<b>Title:</b></font></td>
<td height=”29″ width=”300″><font size=2 face=arial>
<input type=”radio” name=”Title” value=”Dr”>
Dr
<input type=”radio” name=”Title” value=”Mr”>
Mr
<input type=”radio” name=”Title” value=”Mrs”>
Mrs
<input type=”radio” name=”Title” value=”Ms”>
Ms
<input type=”radio” name=”Title” value=”Miss”>
Miss</font></td>
<td height=”29″ width=”12″>&nbsp; </td>
</tr>
<tr>
<td width=8>&nbsp;</td>
<td colspan=2><font color=#00549a size=2 face=arial>
&nbsp;&nbsp;<b>Personal Details:</b></font></td>
<td width=”12″>&nbsp;</td>
</tr>
<tr>
<td width=8>&nbsp;</td>
<td align=right width=”300″> <font size=2 face=arial>First
name: </font></td>
<td width=”300″><font size=2 face=arial>
<input type=text name=FirstName size=30>
</font></td>
<td width=”12″>&nbsp;</td>
</tr>

to post a comment
JavaScript

1 Comments(s)

Copy linkTweet thisAlerts:
@TheBearMayMar 22.2006 — There may be others but the one that jumps out is:

document.detailsform.FirstName.value();

value is not a function, are you trying to set focus or ???
×

Success!

Help @qhen 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.25,
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,
)...