Welcome to WebmasterWorld Guest from 54.162.49.89

Forum Moderators: incrediBILL

Message Too Old, No Replies

Form won't submit

Despite repeated clicking and cursing.

     
6:35 pm on May 20, 2011 (gmt 0)

Senior Member

WebmasterWorld Senior Member wheel is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Feb 11, 2003
posts:5069
votes: 12


I'm stumped, clearly doing something stupid. I've got a form that won't submit when I click on the button. I get the little hand indicating it's clickable. But no combination of clicking and cursing produces any effect - the form won't submit.

<form action="http://www.example.com/program.php" id="formid" method="POST">

{ bunch of input fields }

<div id="getquotesbtn"><input type="submit" name="getqbtn"></div>
<div id="other link"><a href="#">click for another actoin</a></div>
</form>

The basic code looks fine to me. There's a bunch of div's in there that I've cut out, but don't see how that affects it. And I'm running this locally, the form action goes to a live url that's not local, again, don't see how that would affect anything.
7:09 pm on May 20, 2011 (gmt 0)

Senior Member from GB 

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month

joined:Aug 13, 2003
posts:1029
votes: 0


Try restarting your browser first of all, I had a problem where Google Chrome would allow me to submit a form but wouldn't pass any fields. Took me a while to realise is was a browser problem!

Is there any JavaScript on the page? Try disabling it in the browser to see if it the culprit.

Also, you could try changing the action to something local, just to see if cross-site form submissions are being blocked by the browser or perhaps even a firewall.
7:16 pm on May 20, 2011 (gmt 0)

Senior Member from US 

WebmasterWorld Senior Member fotiman is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Oct 17, 2005
posts:4988
votes: 12


1st step should be to validate [validator.w3.org] your markup. Perhaps you have an extra quote or something causing your submit button to be "outside" of your form.
11:25 pm on May 20, 2011 (gmt 0)

Senior Member

WebmasterWorld Senior Member rocknbil is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Nov 28, 2004
posts:7999
votes: 0


Tell us it's this

<input type="submit">

and not

<input type="button">

right?
1:11 am on May 21, 2011 (gmt 0)

Senior Member

WebmasterWorld Senior Member wheel is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Feb 11, 2003
posts:5069
votes: 12


yes, it's input type=submit.

I tried validating. Lots of errors, but nothing related to the form. Turned off javascript, no change.

just to see if cross-site form submissions are being blocked by the browser or perhaps even a firewall.

Can't imagine it would be this though. I've sold calculators through the years that did this, never had a problem in my browser on any client's site.
6:42 pm on May 21, 2011 (gmt 0)

Senior Member

WebmasterWorld Senior Member wheel is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Feb 11, 2003
posts:5069
votes: 12


OK, so this doesn't work:
<div id="getbtn"><input type="submit" name="getbtn">/div>

But this does:
<span class="getbtn"><input type="submit" name="getbtn"></span>

Except the second one doesn't give me a nice graphical button, it gives me the standard submit button (which is not what I'm looking to do). In the second one, I changed two things, the div to span, and id to class.
7:16 pm on May 21, 2011 (gmt 0)

Senior Member from US 

WebmasterWorld Senior Member fotiman is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Oct 17, 2005
posts:4988
votes: 12


Your first one is missing a < before /dig.
7:18 pm on May 21, 2011 (gmt 0)

Senior Member from US 

WebmasterWorld Senior Member fotiman is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Oct 17, 2005
posts:4988
votes: 12


You have 2 elements, 1 with an id that matches the name of the other... best to avoid that.
8:57 pm on May 21, 2011 (gmt 0)

Senior Member

WebmasterWorld Senior Member wheel is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Feb 11, 2003
posts:5069
votes: 12


Resolved.

Thanks fotiman. That wasn't quite it, but almost. It seems surrounding the input tag with a div tag screws things up. THis does work:
<input type="submit" class=getbtn>

i.e. remove the div tags and it works fine.
8:07 pm on May 22, 2011 (gmt 0)

New User

5+ Year Member

joined:July 10, 2009
posts: 3
votes: 0


If you are using id and name attributes for the CSS only, I would suggest to get rid of them at all. Use class attribute instead.
11:21 am on June 3, 2011 (gmt 0)

New User

5+ Year Member

joined:Apr 5, 2011
posts:9
votes: 0


Yes, I agree with Vladimir.