/    Sign up×
Community /Pin to ProfileBookmark

Submitting a form using javascript

Hi,
I have a form which displays questions with 5 options as radio buttons. I have a timer attached with the page. After the timer times out I need to submit the form automatically. The form should not be submitted before the timer reaches zero.
Please provide me the solution for this problem.

to post a comment
JavaScript

4 Comments(s)

Copy linkTweet thisAlerts:
@CrazyMerlinMay 07.2007 — <i>
</i>var myForm = document.forms['name_of_form'];
myForm.submit();


that simple
Copy linkTweet thisAlerts:
@abhi_firewallauthorMay 07.2007 — Thanks its working now.

Is there any way to hide a submit button rather than disabling it?
Copy linkTweet thisAlerts:
@CrazyMerlinMay 08.2007 — sure,

var sub_butt = document.getElementById('button_id');

sub_butt.style.display = "none";
Copy linkTweet thisAlerts:
@felgallMay 08.2007 — If the form is submitting automatically then why not just delete the unnecessary submit button.
×

Success!

Help @abhi_firewall spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...