Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 187
  • Last Modified:

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.
0
JoeMunguia
Asked:
JoeMunguia
  • 2
1 Solution
 
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.

Join & Write a Comment

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now