Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Re: How to call a JS function on the form loading?

Reply
Thread Tools

Re: How to call a JS function on the form loading?

 
 
Alexey Smirnov
Guest
Posts: n/a
 
      03-02-2010
On Mar 2, 2:53*pm, "aspfun via DotNetMonster.com" <u53138@uwe> wrote:
> How to call the function validate() on the form loading?
> There is a form in which another program will fill some text boxes
> automatically.
> I need this JS function to test the value of text boxes and give user a alert
> if any text box is empty.
>
> <script type="text/javascript">
> function validate()
> {
> * var t1 = document.getElementById('<%=txtOrderProduct.Client ID%>');
> * var t2 = document.getElementById('<%=txtOrderBy.ClientID%>' );
>
> * if(t1.value == "" && t2.value == "")
> * {
> * * alert("Empty');
> * }}
>
> </script>
>
> --
> Message posted via DotNetMonster.comhttp://www.dotnetmonster.com/Uwe/Forums.aspx/asp-net/201003/1


Use <body onload="validate();">.

Hope this helps
 
Reply With Quote
 
 
 
Reply

Thread Tools

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 Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
How to call function whose function call with arguments is in astring Options grbgooglefan C Programming 4 01-30-2008 05:12 PM
How to call function whose function call with arguments is in astring grbgooglefan C++ 2 01-30-2008 07:18 AM
How to call function whose function call with arguments is in astring Options grbgooglefan C Programming 0 01-30-2008 04:19 AM
write a function such that when ever i call this function in some other function .it should give me tha data type and value of calling function parameter komal C++ 6 01-25-2005 11:13 AM



Advertisments