runtime error while calling a subroutine

HAving a runtime error while calling a subroutine().

thanks:

<%@ Language=VBScript %>
<HTML>
<HEAD>
</HEAD>
<BODY>

<P><STRONG>Name </STRONG>  <INPUT id=text1 name=text1></P>
<P><STRONG>Email&nbsp; </STRONG><INPUT id=text2 name=text2></P>
<P>&nbsp;</P>
<P><INPUT LANGUAGE = "VBSCRIPT" type=button
      value=Button ONCLICK="call Validation()"  
      NAME="btn1" ></P>
<P>&nbsp;</P>

<%
Sub Validation()
      Select Case True
            Case text1.value = ""
                  msgbox "Please Enter Text"
                  ret = false
                  call text1.focus()
            Case text2.value = ""
                  msgbox "Please Enter Text"
                  ret = false
                  call text2.focus()
            case else
                  ret=true
            
      End Select
      
End Sub


%>


</BODY>
</HTML>
tparvaizAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

PBallCommented:
Confusion.

Client Side Script trying to call Server Side Script.  A no no.

Anything ASP (<% ... %>) will be executed before the page is sent to the client browser.

Your event handler cannot find any client side function called Validation.

<HTML>
<HEAD>

<SCRIPT LANGUAGE="VBScript">

Sub Validation()
  Select Case True
  Case text1.value = "" 
    msgbox "Please Enter Text"
    ret = false
    call text1.focus()
  Case text2.value = "" 
    msgbox "Please Enter Text"
    ret = false
    call text2.focus()
  case else
    ret=true
  End Select
End Sub

</SCRIPT>

</HEAD>
<BODY>

<P><STRONG>Name </STRONG>  <INPUT id=text1 name=text1></P>
<P><STRONG>Email&nbsp; </STRONG><INPUT id=text2 name=text2></P>
<P>&nbsp;</P>
<P><INPUT LANGUAGE = "VBSCRIPT" type=button
value=Button ONCLICK="Validation()"  
NAME="btn1" ></P>
<P>&nbsp;</P>

</BODY>
</HTML>
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
tparvaizAuthor Commented:
Thanks PBall
I am increasing points because I have another question.
On correct/valid inputs, I want to send text data to another .asp file and would  like to read data there
thanks
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP

From novice to tech pro — start learning today.