hiding submit button

A

Andrew Poulos

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
 
A

Andrew Poulos

Andrew said:
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
 
E

Evertjan.

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,065
Latest member
OrderGreenAcreCBD

Latest Threads

Top