tom-mt
08-09-2002, 10:16 PM
Hi there,
I have a form in which the "name", "country" and "comments" fields must not be empty when submitting. If any of them is empty, then an alert popup box should appear, asking the user to fill them up, but the alert box is not functioning; instead, itīs redirecting the user to a 500error page. This is a news post script that Iīve downloaded and customized the look of it myself, and the original page works well (popping up the alert box) but the one that Iīve customized donīt work. The javascript code in the HEAD tag is exactly the same as the original file, as I did a copy&paste, and to be sure, I verified it line by line, so I guess the error is in the FORM tag itself. Well, the relevant code is this(the complete page can be seen at url (http://www.motiontheque.com/news/news_comments.asp?NewsID=35) ):
<form method="post" name="frmNewsComments" action="add_comments.asp?NewsID=35" onsubmit="return CheckForm();">
<div class="row">
<span class="label">Nome:</span><span class="formw"><input type="text" name="name" size="30" maxlength="30" /></span>
</div>
<div class="row">
<span class="label">País:</span><span class="formw">
<select name="country">
<option value="" selected="selected">Pull down to select</option>
<option value="Brasil">Brasil</option>
<option value="Other">Other</option>
</select>
</span>
</div>
<div class="row">
<span class="label">E-mail:</span><span class="formw"><input type="text" name="email" size="30" maxlength="50" /></span>
</div>
<div class="row">
<span class="label">Comments*:</span>
<span class="formw">
<textarea name="comments" cols="40" rows="6"></textarea>
</span>
</div>
<div class="row">
<span class="formw">
<input type="submit" name="submitbtn" value="Add Comments" />
<input type="reset" name="Reset" value="Clear Form" />
</span>
</div>
<div class="row">
<span class="label">Click on Icon to add to your message</span>
<span class="formw">
<a href="javascript:AddSmileyIcon(':)')"><img src="news_images/smiley1.gif" alt="smiley1" /></a>
<a href="javascript:AddSmileyIcon(';)')"><img src="news_images/smiley2.gif" alt="smiley2" /></a>
<a href="javascript:AddSmileyIcon(':o')"><img src="news_images/smiley3.gif" alt="smiley3" /></a>
<a href="javascript:AddSmileyIcon(':D')"><img src="news_images/smiley4.gif" alt="smiley4" /></a>
<a href="javascript:AddSmileyIcon(':errr:')"><img src="news_images/smiley5.gif" alt="smiley5" /></a>
<a href="javascript:AddSmileyIcon(':(')"><img src="news_images/smiley6.gif" alt="smiley6" /></a>
<a href="javascript:AddSmileyIcon('X(')"><img src="news_images/smiley7.gif" alt="smiley7" /></a>
</span>
</div>
</form>
I have a form in which the "name", "country" and "comments" fields must not be empty when submitting. If any of them is empty, then an alert popup box should appear, asking the user to fill them up, but the alert box is not functioning; instead, itīs redirecting the user to a 500error page. This is a news post script that Iīve downloaded and customized the look of it myself, and the original page works well (popping up the alert box) but the one that Iīve customized donīt work. The javascript code in the HEAD tag is exactly the same as the original file, as I did a copy&paste, and to be sure, I verified it line by line, so I guess the error is in the FORM tag itself. Well, the relevant code is this(the complete page can be seen at url (http://www.motiontheque.com/news/news_comments.asp?NewsID=35) ):
<form method="post" name="frmNewsComments" action="add_comments.asp?NewsID=35" onsubmit="return CheckForm();">
<div class="row">
<span class="label">Nome:</span><span class="formw"><input type="text" name="name" size="30" maxlength="30" /></span>
</div>
<div class="row">
<span class="label">País:</span><span class="formw">
<select name="country">
<option value="" selected="selected">Pull down to select</option>
<option value="Brasil">Brasil</option>
<option value="Other">Other</option>
</select>
</span>
</div>
<div class="row">
<span class="label">E-mail:</span><span class="formw"><input type="text" name="email" size="30" maxlength="50" /></span>
</div>
<div class="row">
<span class="label">Comments*:</span>
<span class="formw">
<textarea name="comments" cols="40" rows="6"></textarea>
</span>
</div>
<div class="row">
<span class="formw">
<input type="submit" name="submitbtn" value="Add Comments" />
<input type="reset" name="Reset" value="Clear Form" />
</span>
</div>
<div class="row">
<span class="label">Click on Icon to add to your message</span>
<span class="formw">
<a href="javascript:AddSmileyIcon(':)')"><img src="news_images/smiley1.gif" alt="smiley1" /></a>
<a href="javascript:AddSmileyIcon(';)')"><img src="news_images/smiley2.gif" alt="smiley2" /></a>
<a href="javascript:AddSmileyIcon(':o')"><img src="news_images/smiley3.gif" alt="smiley3" /></a>
<a href="javascript:AddSmileyIcon(':D')"><img src="news_images/smiley4.gif" alt="smiley4" /></a>
<a href="javascript:AddSmileyIcon(':errr:')"><img src="news_images/smiley5.gif" alt="smiley5" /></a>
<a href="javascript:AddSmileyIcon(':(')"><img src="news_images/smiley6.gif" alt="smiley6" /></a>
<a href="javascript:AddSmileyIcon('X(')"><img src="news_images/smiley7.gif" alt="smiley7" /></a>
</span>
</div>
</form>