I want a JavaScript validation function to fire on an ASP.NET textbox's
change event.
Here's what I've been trying and it is not working. The following added
in the webform's page load event:
txtBirthdate.Attributes.Add("txtBirthdate_TextChan ged",
"MyJSFunction()")
txtBirthdate.Attributes.Add("TextChanged", "MyJSFunction()")
txtBirthdate.Attributes.Add("onchange", "MyJSFunction()")
txtBirthdate.Attributes.Add("onChange", "MyJSFunction()")
I've been usual a simliar construct sucessfully with .net hyperlinks:
hlSSN.Attributes.Add("onclick",
"openMessageWindow('../Information.htm')")
Thank you very much. 5 2565
I suggest you customize one of the validation controls.
This article shows you how: http://SteveOrr.net/articles/Validation.aspx
--
I hope this helps,
Steve C. Orr, MCSD, MVP http://SteveOrr.net
<JJ****@hotmail.com> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com... I want a JavaScript validation function to fire on an ASP.NET textbox's change event.
Here's what I've been trying and it is not working. The following added in the webform's page load event:
txtBirthdate.Attributes.Add("txtBirthdate_TextChan ged", "MyJSFunction()")
txtBirthdate.Attributes.Add("TextChanged", "MyJSFunction()")
txtBirthdate.Attributes.Add("onchange", "MyJSFunction()")
txtBirthdate.Attributes.Add("onChange", "MyJSFunction()")
I've been usual a simliar construct sucessfully with .net hyperlinks:
hlSSN.Attributes.Add("onclick", "openMessageWindow('../Information.htm')")
Thank you very much.
Thank you very much. I will review with great interest and expectation.
J.
Also...
I am wondering if you can recommend a resource or an approach to
validating international telephone and address info.
I note that while .NET features validators for distinct entities --
such as a French phone number OR a German phone number -- there is no
control for validating a phone number which in theory could be entered
by a user from any country. I note that the .net validators are
designed for European countries, and of them, only very few are
represented...
I had thought about creating a custom validator that would run through
the countries I could define, but is this really the best way to do
things when in theory, each country could feature a very distinct phone
number format. The same question concerns me regarding postal codes.
?
Thank you again for any and all.
J.
It definitely sounds like some custom code would be needed to fit your
somewhat unique requirements.
--
I hope this helps,
Steve C. Orr, MCSD, MVP http://SteveOrr.net
<JJ****@hotmail.com> wrote in message
news:11**********************@o13g2000cwo.googlegr oups.com... Also...
I am wondering if you can recommend a resource or an approach to validating international telephone and address info.
I note that while .NET features validators for distinct entities -- such as a French phone number OR a German phone number -- there is no control for validating a phone number which in theory could be entered by a user from any country. I note that the .net validators are designed for European countries, and of them, only very few are represented...
I had thought about creating a custom validator that would run through the countries I could define, but is this really the best way to do things when in theory, each country could feature a very distinct phone number format. The same question concerns me regarding postal codes.
?
Thank you again for any and all.
J.
Yes. I am surprised that it is unique. I suspect/hope things will look
quite different 10 year from now.
J. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Ronan Dodworth |
last post by:
Hi there
I'm having a little bit of a problem with my customvalidator control.
The problem is the javascript runs fine on my local webserver IIS but
not when I post it to the web hosting server....
|
by: D Sheldon |
last post by:
I am creating a server control that adds web controls (i.e. textboxes, etc) to a form. I use HtmlTable to build the table and insert the controls. Now I want to add validators to the textbox. Here...
|
by: Jack |
last post by:
Hi,
I have a page with a repeater control that contains textboxes. I'm trying
to create a validation class that is called by my page. A method in this
class iterates through all the controls...
|
by: MattB |
last post by:
I have a page with dual controls for a person to enter their height and
weight. The dual controls are for English and metric units, and
Javascript onChange events handle populating the other...
|
by: Newcomsas |
last post by:
Hello,
I'm trying to solve a problem with JS textbox array without success.
I have two buttons in my page: PLUS and MINUS; at every click on PLUS a new
textbox named 'dear' is generated. So, if...
|
by: cemcat |
last post by:
Hello,
We have an ASP.NET 2.0 (C#) web form that contains a textbox for users to
enter multiple e-mail addresses separated by semicolons. We need to
validate that each individual e-mail address...
|
by: karen987 |
last post by:
I have a comment form, on a news website, ASP page, which users fill in and it adds comments to a news article. The reader clicks on a headline and the comments open up in a new window. It already...
|
by: Andy B |
last post by:
How do you add javascript to a page from codebehind? I have a method I am
working on that has a few conditions in it:
1. if either 1 or both WordTextBox or DefinitionTextBox is empty, show a...
|
by: Garudzo |
last post by:
I am developing an application using the gridview. the last column is a total column I want to compare the typed in value to the sum of values in the rest of the cells. I tried to use custom...
|
by: Faith0G |
last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
|
by: ryjfgjl |
last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
| |