Help urgent

hi to all , I created an agent as you can see down . Dim test As Integer

Print "<Script Language='Javascript'>"

Print {var askme}

Print {askme=confirm("Hi")}

Print  "if(askme== true){'window.document.forms[0].test.value =1'}"

Print "alert('"test"')"

Print "</Script>"

the problem that the value of FIELD test dose not change to 1

can any one help me and tell me where did i go wrong

Subject: HELP URGENT

Without knowing how are you running this agent - WQO or via a button I do see a problem with this code.

Remove single quotes from this line:

Print “if(askme== true){‘window.document.forms[0].test.value =1’}”

It should look like this:

Print “if(askme== true){window.document.forms[0].test.value =1}”

Generally if you want to setup field values in an agent you can just use LotusScript instead of JavaScript.

Subject: RE: HELP URGENT

am using a button to run the agent ,and i tried it without the single quotes before (done,with error) .i need to change the field value after the confirm is true and it must be be changed in the JS enbaded code so i can use it in LS validations

Subject: RE: HELP URGENT

Just a reminder that JS is case sensitive so test != Test. It is possible that you got an error because of that or that your resulting page generated by your agent does not have that field available. In order, for JS to update a field it has to be available on the page(visible or hidden).

Also, try to do all your front-end validation using JS first and then submit the document so that your WQS agent can use the updated fields for additional processing using LS.

Subject: RE: HELP URGENT

i checked the code there is nothing wrong with it but i need to know if you ever tried something like what am trying to do and did it work

and if you have any code that it works

Subject: RE: HELP URGENT

Based on the code you posted, the agent is printing a Web page without an HTML form and without the “test” input field. View the source of your Web page to see it. Also, your alert is showing the word “test” not the value of the input field named “test.” Here is what your agent should look like:

Print "<form>"

Print |<input type="hidden" name="test" />|

Print "<Script Language='Javascript'>"

Print {var askme}

Print {askme=confirm("Hi")}

Print "if(askme== true){window.document.forms[0].test.value =1}"

Print "alert(window.document.forms[0].test.value)"

Print "</Script>"

Print "</form>"

I have a feeling there is more to your code than what is presented here. Download Firefox and Firebug and run your code there to debug the JavaScript.

Subject: I can only wish you good luck, Michelle

Nobody else was able to help regarding this same problem in these threads:

http://www-10.lotus.com/ldd/nd6forum.nsf/ShowMyTopicsAllFlatweb/9b22c293db82e6a685257392002513bb?OpenDocument

http://www-10.lotus.com/ldd/nd6forum.nsf/ShowMyTopicsAllFlatweb/48b6e997a13bda048525738c00388799?OpenDocument

Subject: HELP URGENT

write the output to a file and you will see the problem

Subject: RE: HELP URGENT

and how can i write the output to a file

Subject: RE: HELP URGENT

open “c:\tmp.js” for output as #1Print #1, “”

close #1

Subject: RE: HELP URGENT

thanks i did it . when i checked the file there was syntax error 800a03ea .can you tell me what dose that mean and how to fix the it