Saving a document via web & Javascript

Hi,

I have a form, one of those annoying popups, which has a question and three options, I want to have no submit button, and want the window to close when I select one of the options.  The part I'm having trouble with is saving the document using the onclick event of the radio button.  Does anyone know an easy way of doing the equivalent of a @Command([filesave]);@command([fileclosewindow])?

thanks,
Joe.
JoeMunguiaAsked:
Who is Participating?
 
CRAKCommented:
In javascript (onClick), try:

document.forms[0].submit();
window.close()
0
 
snocrossCommented:
I'm sure there's other ways but here's how I do it.  Put this code in the HTML attributes of the field:

"SIZE=14 onClick=\"SaveIt()\""

Next put this code on your form and format it as passthrough HTML:

function SaveIt()
{document._NewPrototype.submit();}
0
 
snocrossCommented:
Woops, left out some code if you are going to embed the JS:

<script language="JavaScript">
function SaveIt()
{document._NewPrototype.submit();}
</script>
0
 
JoeMunguiaAuthor Commented:
thanks for your answers!  CRAK got there first, problem now solved, another tick on the job sheet, must be time for a coffee..

cheers,
Joe.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.