How to combine javascript validation and agent

Hi All, I wrote java script validation function in Jsheader, and having an agent which is used to lot of complicated calculation and also used to send mail. i have created an action button and wrote the following formula.

"@URLOPEN(“javascript:inputvalidation()”);

@Command([ToolsRunMacro];“RefNo”)"

it gives error , how to combine both please advice me.

regds

soma

Subject: how to combine javascript validation and agent

thanks a lot it worked fine.

Subject: how to combine javascript validation and agent

I am assuming that “RefNo” is a LotusScript agent. You should make the onClick event of the button call the inputValidation(), then if it passes, save the document, document.forms[0].submit(). You can then run the “RefNo” from the WebQuerySave.