469,271 Members | 1,707 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,271 developers. It's quick & easy.

hiding submit button

I have a form with a submit button and an onsubmit event.

fCheckform = function() {
var status = false;
//
// some checking here, if its ok then status get set to true
//
if (status) {
var el = document.forms["details"].elements["finish"];
el.style.visibility = "hidden";
}
return status;
}

<form name="details" method="post" action="test.php"
onsubmit="fCheckform()">

<input name="finish" type="submit" value="Finish">
What's happening is that the submit button flashes off and then back on
when 'status' is true. Is there a way to keep/make the submit hidden if
fCheckform returns true?

Andrew Poulos
Mar 30 '07 #1
2 2836
Andrew Poulos wrote:
I have a form with a submit button and an onsubmit event.

fCheckform = function() {
var status = false;
//
// some checking here, if its ok then status get set to true
//
if (status) {
var el = document.forms["details"].elements["finish"];
el.style.visibility = "hidden";
}
return status;
}

<form name="details" method="post" action="test.php"
onsubmit="fCheckform()">

<input name="finish" type="submit" value="Finish">
What's happening is that the submit button flashes off and then back on
when 'status' is true. Is there a way to keep/make the submit hidden if
fCheckform returns true?
I did some more testing and it looks like the page is getting reloaded
each time fCheckfrom returns - I'm incrementing a global variable in
fCheckform and when I alert its value its always the same???

Andrew Poulos
Mar 30 '07 #2
Andrew Poulos wrote on 30 mrt 2007 in comp.lang.javascript:
I have a form with a submit button and an onsubmit event.

fCheckform = function() {
var status = false;
//
// some checking here, if its ok then status get set to true
//
if (status) {
var el = document.forms["details"].elements["finish"];
el.style.visibility = "hidden";
}
return status;
}

<form name="details" method="post" action="test.php"
onsubmit="fCheckform()">

<input name="finish" type="submit" value="Finish">
What's happening is that the submit button flashes off and then back on
when 'status' is true. Is there a way to keep/make the submit hidden if
fCheckform returns true?
Not if you submit to a new instance of the same page.
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Mar 30 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

22 posts views Thread by Mr Newbie | last post: by
5 posts views Thread by hrpreet | last post: by
11 posts views Thread by Alex | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.