[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Javascript syntax within response.write statement

Posted on 2014-08-12
4
Medium Priority
?
210 Views
Last Modified: 2014-08-12
Hello all.  I have a bit of AJAX in which I am trying to add an OnClick() javascript call with 2 elements.  I have it working with one, but when I try to add a second, either nothing happens, or I error out.  

Below is the good code:
response.write("<input NAME='txtHours' TYPE='text' readonly='readonly' OnClick='GetNames(" & rsFiltered("dbReqNo") & ")' ID='txtHours' SIZE='20' />")

Open in new window


I need to add another static element of 'AssignedTo' to send to the function, and I tried the following with no success:
response.write("<input NAME='txtHours' TYPE='text' readonly='readonly' OnClick='GetNames(" & rsFiltered("dbReqNo") & ", "AssignedTo")' ID='txtHours' SIZE='20' />")

Open in new window


Any help would be appreciated.

Thanks,

Mike
0
Comment
Question by:tmss_it_dept
  • 2
  • 2
4 Comments
 
LVL 34

Accepted Solution

by:
Big Monty earned 400 total points
ID: 40255856
try this:

response.write("<input NAME='txtHours' TYPE='text' readonly='readonly' OnClick='GetNames(" & rsFiltered("dbReqNo") & ", ""AssignedTo"")' ID='txtHours' SIZE='20' />")

Open in new window

0
 

Author Comment

by:tmss_it_dept
ID: 40255901
Genius I say...   I swear I tried every combination of quotation marks possible...   :)    Thank you so much for you help.

Mike
0
 

Author Closing Comment

by:tmss_it_dept
ID: 40255907
Very timely and accurate...
0
 
LVL 34

Expert Comment

by:Big Monty
ID: 40255914
sometimes it just helps to have another set of eyes look at things :)

Remeember, any time you want to do a Response.Write doubleQuotes, just double them up and it'll work every time!
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
This article discusses how to implement server side field validation and display customized error messages to the client.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Suggested Courses
Course of the Month17 days, 18 hours left to enroll

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question