If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > How to validate data in form

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 08-03-04, 04:54
graceson graceson is offline
Registered User
 
Join Date: Mar 2004
Location: India
Posts: 56
How to validate data in form

Dear friends,

How to validae the data from a form before storing in db. Here I am using following code to find the blank fields
but it is not working

Please help me in issue

function isdata(data)

if data=" " then

MsgBox "Please Enter the Field"

else

end if

end function


graceson
Reply With Quote
  #2 (permalink)  
Old 08-03-04, 13:21
DBA_Rahul DBA_Rahul is offline
Registered User
 
Join Date: May 2004
Location: bangalore
Posts: 270
try out this JAVASCRIPT


function field_isempty(str)
{
if (str.length==0)
return(true)
else
return(false)
}
__________________
Reply With Quote
  #3 (permalink)  
Old 08-04-04, 02:11
Bullschmidt Bullschmidt is offline
Guru
 
Join Date: Jun 2003
Location: USA
Posts: 1,032
Here are some client-side validation resources:

Javascript Field Validations -- Client Side Scripting by Nannette Thacker - 8/19/1999
http://www.shiningstar.net/articles/...ions.asp?ID=AW

Form Validation Using Javascript - 9/19/1998
http://www.4guysfromrolla.com/webtech/091998-1.shtml
Good tips such as saving JavaScript functions in a file called DataValidation.js and including this in pages that need this.
JavaScript functions.

WebDaily: Your daily source for Web Technology Tips and Tricks! - 10/27/1998
http://www.4guysfromrolla.com/webtech/102798-1.shtml
Just checks if fields filled in.

Form Validation Scripts
http://www.coolnerds.com/jscript/formval.htm

Try This
chunky - 5/14/2001 1:51:12 AM
http://www.aspmessageboard.com/forum...12975&P=1&F=20
__________________
J. Paul Schmidt, Freelance Web and Database Developer
www.Bullschmidt.com
Access Database Sample, Web Database Sample, ASP Design Tips
Reply With Quote
  #4 (permalink)  
Old 08-04-04, 02:12
Bullschmidt Bullschmidt is offline
Guru
 
Join Date: Jun 2003
Location: USA
Posts: 1,032
And here are some server-side validation resources:

Server-Side Form Validation by Dianna Leech - 12/1/1999
http://www.4guysfromrolla.com/webtech/120199-1.shtml

An Email Validation Routine by Joćo Vieira - 4/11/1999
http://www.4guysfromrolla.com/webtech/041199-1.shtml
Somewhat shorter.

An Email Validation Script by Ben Durbin - 5/19/1999
http://www.4guysfromrolla.com/webtech/051999-1.shtml
Longer.

Form Handler: Some light form validation and error notification.
http://www.asp101.com/samples/form_handler.asp
Uses function to loop thru all fields in a form.
Also shows Response.Write using double double quotes:
Response.Write "<IMG SRC=""../images/check.gif"" BORDER=""0"" WIDTH=""25"" HEIGHT=""25"">"

ASP/Jscript Email Validation - 5/28/1999
http://www.4guysfromrolla.com/webtech/052899-1.shtml
Uses JavaScript run at the server.

Form to DB: Insert records retrieved from a form into a database
http://www.asp101.com/samples/form_to_db.asp
__________________
J. Paul Schmidt, Freelance Web and Database Developer
www.Bullschmidt.com
Access Database Sample, Web Database Sample, ASP Design Tips
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On