Survey Forums

HomeHomeSurvey Project ...Survey Project ...Using Survey & ...Using Survey & ...get current date function?get current date function?
Previous
 
Next
New Post
8/9/2012 12:57 AM
 
Hello,

Answers/ hints:

- How is it the built in JavaScripts work? (just in general)
--> you have to check the source code for that

- When I choose to make an answer type with javascript, what is the format I should choose? (i.e. add the <script> tags, do I need to have it as a function, etc...)
--> dont add script tags

- The field "Javascript function name :" is it mandatory?
--> not necessarily, but just add a name

- What do I need to put in "Error message :" field?

General suggestions:
- open one of the default answertypes and see how they use the javascript fields (including error message);
- use firebug or some other tool to check the endresult in the html page (if the script reference isnt there, there's an error in the script - most of the time its added just after the start of the body tag


 
New Post
8/9/2012 1:58 AM
 

Thank for the tips. One more question: does it have to be a function when I put the code in the answer type javascript text area?

 

Btw, the script is there and I had a document.write to see is the code if working and it does. Its just that the field remains empty. Any ideas?

 

EDIT#1: I noticed something. In my latest code presented here in this thread, the script is placed after the field. I tried placing the script of the above code just after the <form> opening tag, as is in the actual source code on the survey page, and it didn't work. I'm trying to see why, cause If I solve this puzzle I think it will work. Meanwhile any ideas why it doesn't work?

 EDIT#2: In the code I have added a document.write() method that prints the current time, just to see if the code works. It works, it prints the time and I checked the source code and the javascript it there just after the <form> opening tag. In other words it seems like the code it placed correctly and it works. It seems like something it cutting the effort short.

- Could it be all those table tags?

- Is there a way to place the code inside the  class "surveyAnswer" or div class "ScrollableDiv"? I think that this might be the problem.

 

 
New Post
8/20/2012 1:41 PM
 
I ve tried everything, I still cant make it work. Any ideas?
 
New Post
8/21/2012 5:18 PM
 
Ok got it to work. Will post a detailed explanation tomorrow.
 
New Post
8/22/2012 10:47 PM
 
That's good news! Looking forward to the final solution.
 
Previous
 
Next
HomeHomeSurvey Project ...Survey Project ...Using Survey & ...Using Survey & ...get current date function?get current date function?