homepage Welcome to WebmasterWorld Guest from 54.211.34.105
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / HTML
Forum Library, Charter, Moderators: incrediBILL

HTML Forum

    
Form won't submit
Despite repeated clicking and cursing.
wheel

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



 
Msg#: 4315457 posted 6:35 pm on May 20, 2011 (gmt 0)

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.

 

PCInk

WebmasterWorld Senior Member 10+ Year Member



 
Msg#: 4315457 posted 7:09 pm on May 20, 2011 (gmt 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.

Fotiman

WebmasterWorld Senior Member fotiman us a WebmasterWorld Top Contributor of All Time 5+ Year Member



 
Msg#: 4315457 posted 7:16 pm on May 20, 2011 (gmt 0)

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.

rocknbil

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



 
Msg#: 4315457 posted 11:25 pm on May 20, 2011 (gmt 0)

Tell us it's this

<input type="submit">

and not

<input type="button">

right?

wheel

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



 
Msg#: 4315457 posted 1:11 am on May 21, 2011 (gmt 0)

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.

wheel

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



 
Msg#: 4315457 posted 6:42 pm on May 21, 2011 (gmt 0)

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.

Fotiman

WebmasterWorld Senior Member fotiman us a WebmasterWorld Top Contributor of All Time 5+ Year Member



 
Msg#: 4315457 posted 7:16 pm on May 21, 2011 (gmt 0)

Your first one is missing a < before /dig.

Fotiman

WebmasterWorld Senior Member fotiman us a WebmasterWorld Top Contributor of All Time 5+ Year Member



 
Msg#: 4315457 posted 7:18 pm on May 21, 2011 (gmt 0)

You have 2 elements, 1 with an id that matches the name of the other... best to avoid that.

wheel

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



 
Msg#: 4315457 posted 8:57 pm on May 21, 2011 (gmt 0)

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.

Vladimir

5+ Year Member



 
Msg#: 4315457 posted 8:07 pm on May 22, 2011 (gmt 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.

virtualemployeeonlin



 
Msg#: 4315457 posted 11:21 am on Jun 3, 2011 (gmt 0)

Yes, I agree with Vladimir.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / HTML
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved