bapak,
You need to use "javascript:submitform();"
as follows
<a href="javascript:submitfor
Main Topics
Browse All TopicsThe Form name is 'annonce' that I want to execute by clicking on 'Voir tout'. But nothing happen.
All code in the same html file except java script which is in its own file (submitform.js).
Any idea?
Thanks.
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Now, how can I pass the name of the script (annonce) by function argument in order to call something like
submitform(annonce).
How should I modify the submitform() function with the embedded form name 'annonce' in order to make it general?
<SCRIPT language=JavaScript type=text/javascript>
function submitform()
{
document.annonce.submit()
}
</SCRIPT>
bapak,
I might have mis-understood your original question but:
The "announce" string in my example is just a function variable text string which was passed to the submitform() function to represent the name of a script, only that I assigned it as "announce" which happens to be similar to the form name "announce", otherwise it could be any other name or number, whatever..!
submit() is a method specific to the form object and is simply used to send the associated form data to the URL in the form's "action=" property.
Thus, "document.annonce.submit()
Regards
bapak:
Just to be clear as to the code you need!
Please confirm if you need to submit the name of a script the along with the data within the submit form, or just to send the name of a function as a string parameter to a javascript function.
(1) If you need to send the name of a script with the submit form data then a simple hidden input textbox would be added within the form as per code snippet below:
(2) if you need to send the name of a function to call, as a string parameter to a javascript function then:
<a href='javascript:submitfor
as per code snippet below:
Regards
Business Accounts
Answer for Membership
by: jagadeesh_motamarriPosted on 2009-10-09 at 10:50:39ID: 25537197
You mean submit the form using onclick event?
Select allOpen in new window