ClientSide Validation
Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: ASP.NET Discussion
Forum Description: Discussion and chat on ASP.NET related topics.
URL: https://forums.webwiz.net/forum_posts.asp?TID=25797
Printed Date: 28 March 2026 at 3:11pm Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com
Topic: ClientSide Validation
Posted By: gangla
Subject: ClientSide Validation
Date Posted: 06 June 2008 at 1:56pm
|
In my application,i want to validate data after user input,if a textbox is meant for an integer value,then it should not allow characters,displaying error message if this is violated,if it is for meant for text,it should only allow text and not integers or other characters..Please assist
|
Replies:
Posted By: Scotty32
Date Posted: 06 June 2008 at 2:22pm
your best option (and probably only option) is to use JavaScripts.
Have alook on http://JavaScriptKit.com - JavaScriptKit.com , they may have what your looking for.
------------- S2H.co.uk - http://www.s2h.co.uk/wwf/" rel="nofollow - WebWiz Mods and Skins
For support on my mods + skins, please use http://www.s2h.co.uk/forum/" rel="nofollow - my forum .
|
Posted By: Videoediting
Date Posted: 07 August 2008 at 1:20pm
function OnlyNames(str) { return /^ *[A-Za-z'\s']+ *$/.test(str); }
if(!OnlyNames(document.getElementById("txtbox").value) ) { flag=true; document.getElementById("lbl").innerHTML="Invalid Name"; }
Cheers,
SP http://www.videoediting-direct.co.uk
|
Posted By: vikas
Date Posted: 23 January 2009 at 1:14pm
Try these steps hope it ll helpful for you..
- Enter in invalid text and submit. Reset form.
- Enter in valid text and submit. Reset form.
- Turn on debug and repeat step 1 and 2.
- Turn off debug and turn on override. Enter errors and submit. Submit again. Reset form.
- Turn off override. Turn off message box. Enter errors and submit. Reset form.
- Turn on show errors in form element. Enter errors and submit. Reset form.
- Change icon and turn on message box. Enter errors and submit. Reset form.
------------- http://www.webdesigningcompany.net/" rel="no follow - Web design
Web Design New Yk
|
Posted By: scottage
Date Posted: 15 June 2009 at 1:15pm
DO NOT rely on Javascript to valid your use input; what happen if I turn off javascript then submit your form? Add validation controls (there are a few; RequiredField, RegularExpress, Compare, etc.) to your form and let them do the work :-)
------------- http://www.realwebdevelopers.com" rel="nofollow - Developing real world websites
|
|