Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Trying to issue a alert or message box after result of file read

Status
Not open for further replies.

charlesb

IS-IT--Management
Dec 14, 2001
26
GB
I have an asp page that carries out validation using javascript.

Once everything is correct I submit the form.

Prior to updating/inserting a record I have to check if other records exist. I do this in the vbscript (<% %>) code in prior to <Head>

I read a record and find that the record is not there, I then need to issue a message to the user with a relevant message.

I have done this before by simply putting an alert between <script language= javascript> </script> tags.

However, this time I need to put some variable values in the message. I have calculated the variable value twice once in Javascript vaidation function called before these reads are performed, and again in vbscript just before trying to issue error message.

Please help, I just cannot see how to get the variable value in my alert box.
 
Do you mean something like this

<%
Response.Write(&quot;<script language='javascript'>alert(&quot;+Variable+&quot;)</script>&quot;)
%>

where Variable is a server side variable

Mark
 
Yes I think so , but how do I get the server side variable to have the value I want?

As I say I have calculated it twice once in Javascript as part of validation and then in vbscript within <% %> tags. I assume both of these are client side code.

 
Chances are the vbscript <% %> is server side, just stick that variable in the alert statement.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top