Print Page | Close Window

How do I make a field Mandatory?

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Classic ASP Discussion
Forum Description: Discussion on Active Server Pages (Classic ASP).
URL: https://forums.webwiz.net/forum_posts.asp?TID=28822
Printed Date: 28 March 2026 at 3:11pm
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: How do I make a field Mandatory?
Posted By: kennywhite
Subject: How do I make a field Mandatory?
Date Posted: 02 September 2010 at 4:36pm
Hello,

I am working on a website using ASP and MS Access. I need to make some fields mandatory in form, but not in the database. How can I do this?

Thanks in advance!



Replies:
Posted By: WebWiz-Bruce
Date Posted: 06 September 2010 at 8:37am
You could either use JavaScript which onsubmit checks that the required fields are filled in, however if someone turns off JavaScript then the code to check will not run.

The other way is to check server side when the form is submitted that the form field contains data:-

If Request.Form("formFieldName") = "" Then 
Response.Write("Please fill in all required fields")
Response.End
End If


-------------
https://www.webwiz.net/web-wiz-forums/forum-hosting.htm" rel="nofollow - Web Wiz Forums Hosting
https://www.webwiz.net/web-hosting/windows-web-hosting.htm" rel="nofollow - ASP.NET Web Hosting



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