Jump to content
  • 0

Multiple Submission form in a single web page


Aariel

Question

Suppose,there are multiple submission form in a same web page. I would like to call javascript function written in respective datapage whenever the 'SUBMIT' button in clicked on each datapage. I tried using document.getElementById("caspioform").onsubmit=function(){....} in all the datapage's footer for calling my javascript. But it is not working...Is this not the correct way ???

appreciate your help.

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

Hello Ariel,

If you have multiple submission form in a same web page, you have to use

document.forms[0].onsubmit=function(){....} . The submission form that is located on the top of your web page is referred as forms[0], the form after it is forms[1] and so on.

Also, you can create a div tag in your header in the 'Web Form Wizard- Configure Fields' . Provide and 'Id' and close this div in footer. This way the contents between header and footer is assigned an id. Then you can use

//in header

//in footer

document.getElementById('div_id').onsubmit=function(){....} //in footer after closing div tag.

I prefer second process because I play with web pages a lot and keep on adding and deleting forms in it. I do not want to change the form array as I change my web page...:)

hope it helps.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...