Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Firefox Js issue 1

Status
Not open for further replies.

funkytunaa

Technical User
Oct 9, 2005
116
AU
I have a simple application form that in IE works properly, as in each time the next button is pressed a new "hidden" page is shown etc until the end of the form in which the form is submitted.

The issue I have is that when the same form is looked at in firefox, the first time the next button is pressed it runs the php file and submits the form rather than going to the next page.

Any ideas that come to mind?

Cheers
 
The form might have a function attached to it when it's submitted, it should return false to NOT submit the form but if it causes an error in firefox it will return nothing and submits the form.

Use firebug plugin and check the console in firefox for errors.

Code:
//script:
function on_form_submit(form){
// stuff here
 if(something){
  return fals; // this will not submit the form
 }
}
<form onsubmit="return form_submit(this)">
</form>



Greetings, Harm Meijer
 
I've had a play but can't quite figure it out, and with me the more I look the more it alludes me. I've pretty much munched it together over time so there is probably a LOT I am doing wrong.

The url is

if you would like to have a look at the source and I've copied the script to

Cheers for all the help!!!!!
CR
 
P.S. Indent your code. It will make it far more legible, make it much understand, follow, and read, and make it much easier to debug and spot errors (for both you and others trying to help you).

Right now, it's so hard to see what is where, I wouldn't want to wade through it to be honest.

Dan



Coedit Limited - Delivering standards compliant, accessible web solutions

[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
Firefox assumes type="submit" with a <button element.

Try <input type="button" value="step ..." instead of <button or return false when it's clicked.



Greetings, Harm Meijer
 
Champion. Works like a charm now.

Just have to clean up the code now.

Cheers Guys!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top