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
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.
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: