473,565 Members | 2,770 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

validation for name

40 New Member
Hi,

I have a textbox and button in my child page it inherits a master page.the textbox should allow to key in only alphabets,comma ,dot,space,sing le quote. And also consecutive comma dot single quote should not be allowed to key in. first and last character should be alphabets.
I have a javascript but it does not check for consecutive comma,dot,singl e quote...please help me..
needed urgently..

thanks in advance,
Blacky
Jul 19 '10 #1
4 2197
shaahin
11 New Member
Hi
Use regular expression.
Its easy to use and u can define for it custom validating
but if ur data is sensitive validate it on ur business layer.
good luck
Jul 19 '10 #2
Frinavale
9,735 Recognized Expert Moderator Expert
In the JavaScript method that you are using to filter the user's input, you will have to grab the text from the TextBox and check for the cases of consecutive commas, dots, and single quotes. Regular expressions can really help with this but they aren't required (if the last letter in the TextBox is a comma, dot, or single quote, and the current key press is the same then don't allow it, otherwise allow it.)
Jul 19 '10 #3
Blacky
40 New Member
@shaahin
Could you please tell me the regular expression that validates my requirements
Jul 20 '10 #4
Frinavale
9,735 Recognized Expert Moderator Expert
@Blacky, I know your clever enough to figure this out for yourself you have the right tools. I use this Regular Expressions Reference and this Regular Expressions Tester whenever I have to use JavaScript Regexs.

-Frinny
Jul 20 '10 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

0
1697
by: motoman | last post by:
i have the following code (see below), i run my validation and get unexpected results. Public ID: null System ID: file:///C:/DATA/Sandpit/Eclipse/workspace/dtdValidation/memory.xml Line number: 4 Column number: 44 Message: Element type "memories" must be declared. Public ID: null
5
2585
by: EviL KerneL | last post by:
Hi - I am trying to figure out a way to enforce the validation included for this form based on whether the user chooses "email" or "phone" as the contact choice. Right now it is set to enforce validation on both. Is there a way to link the drop-down choice to the correspondent validation section while disabling validation for the other...
2
5166
by: Sudip Chakraborty | last post by:
Is there a way to see constraint validation errors while loading xml into a DataSet ? I'm interested in the line number in the xml file which is causing the error. I've enclosed the relevant stack trace below. at System.Data.DataSet.FailedEnableConstraints() at System.Data.DataSet.EnableConstraints() at...
7
2862
by: A.M | last post by:
Hi, I have a validation control in my page that upon any invalid data, it disables all buttons in the page. basicly i don't have any postback in the page if the validator finds any error. How can have the validator just disable certain control's postback and other part of page continue their functionality. Thanks,
2
6691
by: Tim Frawley | last post by:
Source code attached indicates my problem with validation and a button bar save button. Fill the Textbox with some text then tab off the control. The message box will display the text in the textbox from the Validating event. Now put the focus back on the textbox click the button bar button. Nothing happens. The form causes validation...
1
6388
by: billa1972 | last post by:
Hi, I am trying to hook into Yellow Freight's rating webservice. Below is the wsdl. When i try and create a proxy file with wsdl.exe i get the following errors, see below. Also, when i reference this wsdl in .NET it seems to do it fine, yet there are no objects to reference except RateQuoteBeanService. In the WSDL it looks like there...
11
2976
by: Rik | last post by:
Hello guys, now that I'm that I'm working on my first major 'open' forms (with uncontrolled users I mean, not a secure backend-interface), I'd like to add a lot of possibilities to check wether certain fields match certain criteria, and inform the user in different ways when the data is wrong (offcourse, this will be checked on posting the...
6
2729
by: lists | last post by:
Hi all, I am trying to validate an XML file against an XSD schema file within a ..NET C++ program, but the validation doesn't seem to be occuring. My code is listed below. The validation event handler is not called even when the XML should valid properly against the schema. Obviously I'm missing something. Can anyone help?
8
2727
by: Bryan | last post by:
I want my business objects to be able to do this: class Person(base): def __init__(self): self.name = None @base.validator def validate_name(self): if not self.name: return
1
11516
by: NamelessNumberheadMan | last post by:
I can't seem to get Struts 2 validations to work. I have been converting from Strust 1 to Struts 2. So far I've refactored all the code (for this particular module) on the back end, rewrote the jsp using Struts 2 notations, and wired up the xml (aside from the abc-validation.xml). Everything runs just fine. If there is an error not generated by...
0
7666
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7584
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8108
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
6260
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5484
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3643
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3626
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2083
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
925
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.