/    Sign up×
Community /Pin to ProfileBookmark

form cannot get submitted

hi,

i have tried using submit() command to submit the form but the form does not get submitted. I wonder why..pls help me on this. I am using lotus designer to develop the form:

var f= document.forms[0];

var answer = confirm(‘Do you want to referback?’)

if(answer ){

alert(f.count.value);
var temp=prompt(“Please provide reason for referback.”,””)
if (temp ==null)
{return false;}
else

alert(‘opps’);
f.referback.value = temp;
f.count.value=3;

f.submit();
}

thanks,

Breentha

to post a comment
JavaScript

3 Comments(s)

Copy linkTweet thisAlerts:
@SMTSSep 03.2011 — Are you sure this is not submitting? What do you expect it to do? The page may not change at all, but indeed the form may be submitting.

Try adding this to your form tag, like so:
[code=html]<form onsubmit="alert('Submit is working')">[/code]

If the form really isn't submitting, nothing will happen. If it is, you will get an alert message.

This will at least confirm that that your form is not submitting.
Copy linkTweet thisAlerts:
@breentha19authorSep 03.2011 — hi,

Thanks for the reply, i have actually coded the codes stated above for a button called "Referback" using onClick event. When i click the button, the form must get submitted and the window should close, but nothing happens instead, so i am wondering what went wrong.


Thanks,

Breentha
Copy linkTweet thisAlerts:
@SMTSSep 04.2011 — I'm sorry. I don't understand. What happened when you tried the code above?
×

Success!

Help @breentha19 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.22,
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,
)...