471,888 Members | 2,365 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,888 software developers and data experts.

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 2872
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
reply views Thread by zermasroor | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.