This topic is locked

Expected end of statement.

3/28/2009 9:56:46 PM
ASPRunnerPro General questions
C
Carrie author

I am using this line of code:

Response.write "<script> $('input[@value="Add new"]').get(0).disabled = true; </script>"
I get this error:

Microsoft VBScript compilation (0x800A0401)

Expected end of statement

/aspr/include/WO_Items_events.asp, line 216, column 42

Response.write "<script> $('input[@value="Add

new"]').get(0).disabled = true; </script>"

-----------------------------------------^
It doesn't amtter if I do this either:

Response.write "<script> $('input[@value=""Add new""]').get(0).disabled = true; </script>"
Huh???
Carrie

R
Roger 3/29/2009

Carrie, this one causes no errors and it works for Disablingthe "ADD NEW" Button (I use it in one of my projects).
Response.write "<script> $('input[@value=""Add new""]').get(0).disabled = true; </script>"
Most likely, you copied and pasted from somewhere and there was probably a weird Editor Based char in the line - that's what happened in my case.
BYW, if you are trying to disable the DELETE button as well let me know, I've been trying to get it to work for quite awhile and just can't.
So, if you get this to work please post or email it to me (r.crottent@gmail.com) , thanks.
Roger.

R
Roger 3/29/2009

Carrie, one more thing. You should check the condition and set a session variable you want to use in the Master Table Info list "Custom Code".
Then use this session variable in the appropriate event.
Roger.

A
andie.caron 3/29/2009

Hi all. I couldn't get the "DISABLE" to work with response.write and the samples from this site.
Instead I do this in the appropriate event:


xt.assign "add_link",false

xt.assign "delete_link",false


Works everytime. No muss, no fuss, no debugging to see what's happening.
Cheers.
Andie.