/    Sign up×
Community /Pin to ProfileBookmark

How to not to reload page on form submit

Hi,
I have a form that holds radio checkboxes (questionnaire) , when user press submit button a function in javascript is executed to evaluate the answers in the questionnaire. Based on how many points the user have got a message is to be displayed on the page(if the user has passed/failed). The problem: All variables are flushed when the user press submit and the page reloads. I want to print out one of the variables on the same page (either by “innerHTML” or “document.write()”. How do I execute this function in the form without a reload of the page? OR How do I maintain the variables on the page when the page reloads?

I can not use any server language since this file will only be published on DVD/CD-ROM.

Thanx in advance
Regards
/Christoffer

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@UltimaterNov 14.2006 — <i>
</i>&lt;form action="#" onsubmit="doSomething()[color=blue];return false[/color]"&gt;
Copy linkTweet thisAlerts:
@ChristofferTauauthorNov 14.2006 — Thank you very much for your very fast reply. I have spent hours to solve this issue.

cheers mate

/Christoffer
×

Success!

Help @ChristofferTau 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 5.19,
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: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

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

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...