468,510 Members | 1,696 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,510 developers. It's quick & easy.

Alert Message

kirubagari
158 100+
Expand|Select|Wrap|Line Numbers
  1. <%        
  2. set cn = server.CreateObject("ADODB.CONNECTION")
  3. cn.open Session("IE_conn")
  4. set rsuser= server.CreateObject("ADODB.RECORDSET")             
  5. sql = "SELECT * FROM SIL_WAFERSTART_LOGIN Where logouttime is null"
  6. set rsuser= cn.execute(sql)
  7. if not (rsuser.eof) then
  8. Response.Write "<script type='text/javascript'>alert(" & rsuser("login") & ");</script>"
  9.  
Hi im having problem when pass d value in alert message?
There is no alert message prompt.If i replace with string the alert message prompt without any problem.
Please help
Aug 8 '12 #1
3 1965
Rabbit
12,513 Expert Mod 8TB
You need to enclose the parameter to alert in quotes.
Expand|Select|Wrap|Line Numbers
  1. Response.Write "<script type='text/javascript'>alert('" & rsuser("login") & "');</script>" 
Aug 8 '12 #2
kirubagari
158 100+
Hi,

Thanks.
I have assigned the value into variable but the alert is not prompt up.

Alert message is prompt up if the variable is string:
Expand|Select|Wrap|Line Numbers
  1. <%        
  2. set cn = server.CreateObject("ADODB.CONNECTION")
  3. cn.open Session("RE_conn")
  4. set rsuser= server.CreateObject("ADODB.RECORDSET")             
  5. sql = "SELECT * FROM SIL_ABC_LOGIN Where logouttime is null"
  6. set rsuser= cn.execute(sql)
  7. if not (rsuser.eof) then
  8. MyVariable = "Yet to be developed."
  9. Response.Write "<script type='text/javascript'>alert('" & MyVariable & "');</script>"
  10.  
  11. end if 
  12. %>
Alert message is not prompt up if i replace with sql data.Please help.I have attached the error for expert reference.

Expand|Select|Wrap|Line Numbers
  1. <%        
  2. set cn = server.CreateObject("ADODB.CONNECTION")
  3. cn.open Session("RE_conn")
  4. set rsuser= server.CreateObject("ADODB.RECORDSET")             
  5. sql = "SELECT * FROM SIL_ABC_LOGIN Where logouttime is null"
  6. set rsuser= cn.execute(sql)
  7. if not (rsuser.eof) then
  8. MyVariable = rsuser ("login")
  9. Response.Write "<script type='text/javascript'>alert('" & MyVariable & "');</script>"
  10. end if 
  11. %>
Attached Images
File Type: jpg untitled.jpg (58.6 KB, 145 views)
Aug 9 '12 #3
Rabbit
12,513 Expert Mod 8TB
If there are any single quotes in the variable data, you will have to escape them.
Aug 9 '12 #4

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

1 post views Thread by Ali | last post: by
1 post views Thread by Vivian | last post: by
22 posts views Thread by Tony Girgenti | last post: by
1 post views Thread by fmendoza | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.