Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - compulsory registration fields
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

compulsory registration fields

 Post Reply Post Reply
Author
villageidiot View Drop Down
Newbie
Newbie
Avatar

Joined: 27 March 2003
Location: United Kingdom
Status: Offline
Points: 14
Post Options Post Options   Thanks (0) Thanks(0)   Quote villageidiot Quote  Post ReplyReply Direct Link To This Post Topic: compulsory registration fields
    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? 



Edited by villageidiot
Back to Top
villageidiot View Drop Down
Newbie
Newbie
Avatar

Joined: 27 March 2003
Location: United Kingdom
Status: Offline
Points: 14
Post Options Post Options   Thanks (0) Thanks(0)   Quote villageidiot Quote  Post ReplyReply Direct Link To This Post 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

 

Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.