Print Page | Close Window

compulsory registration fields

Printed From: Web Wiz Forums
Category: Web Wiz Web App Support Forums
Forum Name: Web Wiz Forums
Forum Description: Support forum for Web Wiz Forums application.
URL: https://forums.webwiz.net/forum_posts.asp?TID=3208
Printed Date: 01 April 2026 at 12:11pm
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: compulsory registration fields
Posted By: villageidiot
Subject: compulsory registration fields
Date Posted: 02 June 2003 at 9:17am

Hi All,

I'm looking for a simple fix if you have any suggestions...

All I want to do is force new registrants to fill in a few extra of the register form fields.

I have tried using javascript (that is tried and tested on other forms I use) but I can't get it to work with all the fields in the register.asp file.

It quite happily forces entries for realName and the Email address but  not for any of the other fields further down the form...

On hitting submit with an incomplete form (say occupation isn't filled in) I would expect a javascript alert requesting the field be completed, but instead the user is registered fine.  Does the javascript not run first being on the client? or is it somehow overridden by the asp?

Either alternatives to the javascript or a pointer what I might be doing wrong would be much appreciated!

Also...

My javascript works perfectly if you "update profile" just not when you register.

as an afterthought...

at the top of the form in register.asp I have:

<form method="post" name="frmRegister" action="register.asp?FID=0" onsubmit="return validateForm(this)" onReset="return confirm('Are you sure you want to reset the form?');">

and at the bottom:         

<input type="submit" name="Submit" value="Register" onClick="return CheckForm();" />

There would seem to be a conflict here no?  Can I run my javascript verification - validateForm(), first then call CheckForm() from within it? 




Replies:
Posted By: villageidiot
Date Posted: 02 June 2003 at 10:41am

Apologies for the monster monologue...

I've managed to solve my problem though if you're interested, by having:

<form method="post" name="frmRegister" action="register.asp?FID=<% = intForumID %>" onsubmit="return validateForm(this)" onReset="return confirm('<% = strResetFormConfirm %>');">

at the top calling my javascript validator i then removed the onClick="return Checkform();" from the bottom and called it from within my validation:

// Start ------->
 
 if (!validEmail(theForm.email,"Email",true))
  return false;

 if (!validRequired(theForm.realName,"Name"))
  return false;

 if (!validRequired(theForm.occupation,"Company"))
  return false;

 if (!validRequired(theForm.interests,"Position"))
  return false;

 return CheckForm();

 // <--------- End

 




Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net