Jump to content

[SOLVED] Submit a form with a link BEFORE the form?


jaxdevil

Recommended Posts

I have a form and I have a flash component that sits at the top of each page that runs off of a .inf file where I can set URLs to open when clicking icons within the flash file. So I have a form that would reside on the page, but as you can tell the flash file is at the top of the page and it makes a nice clean looking menu like a windows menu with file, edit, view, etc. so I can click file and it drops down and has a 'save' command. So I would like to be able to fill out the form and click the 'save' button in the flash file and have the form submit. The only thing that the flash file can do is open a url, so I am trying to figure out a method to submit the form with a link that resides ABOVE the form itself. Any ideas? Some ideas I have been mulling around are  an iframe that I can target with the flash (the option to target the link is available as a feature of the inf file.) So is there a way I can target a submit button in an iframe below the form that has a an 'onload' function that autosubmits the form submit button onload, that way when I click the save button in the flash, the iframe is loaded containing an onload submit button so it submits the form when the flash link is clicked? Or maybe the submit button is a transparent gif below the form with a submit javascript applied when some other area is loaded and the link loads that area in a different iframe. Any ideas?

 

Thanks,

SK

I figured it out. I used this bit of code:

 

<SCRIPT language="JavaScript">
function submitform()
{
  document.myform.submit();
}
</SCRIPT> 

 

Named the form 'myform' and made the link in the flash point to: 'javascript: submitform()'

 

So it submits the form when the link is clicked even though the link is before the form.

 

Hope this helps someone :)

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.