|
have you tried to remove the "^" and "$" characters?these specify the beginning("^") and the end("$") of a line.so it makes no sense if "\n" is placed between these two.
walter
|
|
|
|
|
I have tried the following (all unsuccessful):
^([0-9a-zA-Z _+-.*()&#%':!])+$\n
^([0-9a-zA-Z _+-.*()&#%':!])\n+$
([0-9a-zA-Z _+-.*()&#%':!])+\n
([0-9a-zA-Z _+-.*()&#%':!])\n+
^([0-9a-zA-Z _+-.*()&#%':!])\r\n+$
^([0-9a-zA-Z _+-.*()&#%':!])+\r\n$
([0-9a-zA-Z _+-.*()&#%':!])+\r\n
([0-9a-zA-Z _+-.*()&#%':!])\r\n+
|
|
|
|
|
what exactly do you want to validate? give me an example of the validated text and the rules you want to apply
walter
|
|
|
|
|
I want to validate something like this:
--------
BBC Health, Article #6180753:
Important!!
Vegetarians were more likely to be female, to be of higher occupational social class and to have higher academic or vocational qualifications than non-vegetarians.
However, these differences were not reflected in their annual income, which was similar to that of non-vegetarians.
Lead researcher Catharine Gale said: "The finding that children with greater intelligence are more likely to report being vegetarian as adults, together with the evidence on the potential benefits of a vegetarian diet on heart health, may help to explain why higher IQ in childhood or adolescence is linked with a reduced risk of coronary heart disease in adult life."
--------
|
|
|
|
|
try this one:
([0-9a-zA-Z _\+-\.\*\(\)%':!\n"])+
hope that helps
walter
|
|
|
|
|
It helped half of the way
It now passes client side, but fails server side.
this.IsValid returns false server side...
|
|
|
|
|
well...;)
there's probably a problem with the view-state in your site, i don't know.
maybe you'll find these links helpful:
RegExLib[^]
and
RegEx-Coach[^] for testing your regular expressions.
good luck
walter
|
|
|
|
|
Great links, thanks.
Now it works perfectly in Firefox, but it fails clientside in bloody Explorer...
I'm using:
([0-9a-zA-Z _\+-\.\*\(\)&#%':!\n"])+
RegEx-Coach say everything is fine about the expression.
|
|
|
|
|
When you handle the OnChange event for textboxes, it only fires when you change the focus to another control. (Also in Javascript).
Is there a way to handle this event when the contents of the textbox is really changing? (eg when you start typing or deleting characters?)
Many thanks.
V.
If I don't see you in this world, I'll see you in the next one... And don't be late. (Jimi Hendrix)
|
|
|
|
|
Are you trying in JavaScript?
If so, try with onkeydown or onkeypress event of the TextBox... This is applicable to JavaScript only...
Regards,
Venkatesh Mookkan.
Software Engineer, India
|
|
|
|
|
tested works and omg , should have seen that ...
|
|
|
|
|
hey, i need to do form validation. need to check if fields are empty,valid email format, postal code n things like this.. how can i integrate requiredFormValidaton and regularExpression in such it will inform user if its empty n once it is filled in but input wrongly, it will only inform user of incorrect input?
|
|
|
|
|
You can use more than one type of validation controls for one controls.
Example: You use requiredfieldvalidator for the textbox for zipcode which check if the textbox value is empty. and to check the format of zipcode value you use regularexpression validator control which will check the format of the zipcode value.
Now whenever validation occurs first requiredfieldvalidator will work. If the controls is not having blank value then the regularexpressionvalidator will check the format of value and gives u error if format is not in proper way.
Thanks and regards,
Chetan Ranpariya.
|
|
|
|
|
gd afternoon, tks. But how will i format the validator for display purposes? i cant overlap the 2 validator am i right?
|
|
|
|
|
I would like to know the difference between publishing and deploying an asp.net web application.
Regards
MLNRao
Intelligence is measured by common sense not by how many scholarly books you read.
|
|
|
|
|
previously we were using visual studio 2002 version and in that version we were having no problems in moving the controls over the form in design time with grid layout.we simply drag and drop the control and move it over the form but in vs 2005 version the controls are not moving over the form with mouse and with keyboard in design time. so please give me the solution of this problem.
|
|
|
|
|
Unlike earlier version, VS2005 needs a strucred format for placing controls on it. So use table, div/layer tags for positioning elements.
Intelligence is measured by common sense not by how many scholarly books you read.
|
|
|
|
|
Hi,
There are two ways to move a control anywhere in the form
1) Goto Tools-->Options and select HtmlDesigner then choose your options to "Absolutely Positioned".
2) Right click over a particular control select style then select position there also you can choose a position to "Absolutely Positioned". Test for all Choices.
|
|
|
|
|
Hai to all,
Here my doubt is ,when we enter some value into textboxes,i want to enter only numerics.
SAme i have to check for Characters,emailAdress(Havinv @ symbol in between).
How to do without using Required Field validator.Give me solution for three different cases.
Thanks in advance
kissy
|
|
|
|
|
Why do u not want to use Required Field Validator. U can use Regulsr Expresssion Validator for all three here u find for accepting only numeric value code. otherwise use Jscript.
asp:RegularExpressionValidator ID="REV_Seats" runat="server" ErrorMessage="* Number Only" ValidationExpression="[0-9]{1,16}" ControlToValidate="txtSeats" Display="Dynamic"
Deepak
Smile a Lots,Its Costs Nothing
|
|
|
|
|
Hai,
Thanks for ur answer,how to do for email address???
If i have more than 20 text boxes in a form for different entries,is it good to use the regular expression???
give me answer.
thanks
kissy
|
|
|
|
|
hi
u can use also RegularExpression for email Validation. follow the RegularExpression basic property and after tht use ValidationExpression into property windows and select Internet email address option click ok.
and if u hav 20 and more controls in a page tht is good to use coz tht validation is run at client side and prevent to user to goto server side.
Deepak
Smile a Lots,Its Costs Nothing
|
|
|
|
|
Hi Guys,
..am beginner in asp.net....I want to delete the row in my gridview.... i am using this code but where i place the code to delete the row....
dataset.Tables["Data"].Rows.RemoveAt(e.RowIndex);
gridview.DataSource=dataset.Tables["Data"];
gridview.DataBind();
Thanks
A.Rajapandian
|
|
|
|
|
Try it in RowDeleting Event of the GridView...
Regards,
Venkatesh Mookkan.
Software Engineer, India
|
|
|
|
|
when i run localhost, it right, but when i run with network, it not display persons conmect this website.
please help me.
Thanks you.
|
|
|
|