By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,162 Members | 1,038 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,162 IT Pros & Developers. It's quick & easy.

Alert Message

kirubagari
100+
P: 158
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
Share this Question
Share on Google+
3 Replies


Rabbit
Expert Mod 10K+
P: 12,369
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
100+
P: 158
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, 135 views)
Aug 9 '12 #3

Rabbit
Expert Mod 10K+
P: 12,369
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.