Apple Event: May 7th at 7 am PT

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Safari 5 not recognizing submit button on forms.

I have a table with a form on each row:


<form method="post" action="index.php">
<input type="hidden" name="pk itemstore" value="10535">
<input type="hidden" name="pk_items" value="2171">



<tr>
<td>


Peanut Butter, Natural,

<label for="aisle"> Aisle:<input name="aisle" type="number" size="2" min="0" max="1000" value="10"></label>



<label for="brand"> Brand:<input type="text" size="6" name="brand" value="365"/></label>

<input name="crud_mode" type="submit" class="button01"value="Update & Buy">
<input name="crud_mode" type="submit" class="button01"value="Update">


$0.72 cheaper at BJ-Dedham

<input name="crud_mode" type="submit" class="button01"value="Item Store Delete">
</td>
<td align="right"
<label for="pkg_qty"> Pkg Qty:<input name="pkg_qty"type="number" size="5" min="0" value="2"></label>



<label for="pkg_size"> Pkg Size:<input name="pkg_size" type="number" size="5" min="0" value="2.25"></label>


<label for="pkg_price"> Pkg Price:<input name="pkg_price" type="number" size="5" min="0" value="3.69"></label>


<label for="pkg_shipping"> Shipping:<input name="pkg_shipping" type="number" size="5" min="0" value="0.00"></label>



<label for="pkg_tax"> Tax:<input name="pkg_tax" type="number" size="5" min="0" value="0.00"></label>


<label for="tax_rate"> Tax Rate:<input name="tax_rate" type="number" size="5" min="0" value="0.000"></label>

</td>
</tr>
</form>







However in Safari 5, the browser will not respond when I click on any of the submit buttons, when I check the console in the Web Inspector I see the following error messages.


-----------

<form> cannot act as a container inside <tbody> without disrupting the table. The children of the <form> will be placed inside the <tbody> instead.
index.php:1559

<input> is not allowed inside <tbody>. Inserting <input> before the <table> instead.


---------------

I have a similar problem with the Chrome beta. Is this a problem with latest version of webkit, or do I need to change something relative to tables and forms?

Mac Mini, Mac OS X (10.6.3), Mac user since 1986

Posted on Jun 11, 2010 7:03 AM

Reply
7 replies

Jun 14, 2010 6:58 PM in response to Adam Ek

I have a similar problem with the Chrome beta. Is this a problem with latest version of webkit, or do I need to change something relative to tables and forms?


Interesting. If it's happening with both Chrome and Safari, it might be worth checking in at the WebKit BugZilla to check to see if it has been reported as a bug:

https://bugs.webkit.org/createaccount.cgi

Jul 10, 2010 8:47 PM in response to wesleya

I found a possible answer. I was coding html forms that had a popup calendar. In IE, the calendar would not "cover up" the submit button on the form until I set the z-index property of the button to -1. That fixed the IE problem, but then I discovered that it stopped the button from working in Safari for both the iPhone and iPad. So I set the z-index to 0, but set it to -1 for the "IE-only" styles. Works great on all browsers now.

Jul 14, 2010 9:14 AM in response to wesleya

Here's the culprit

<input name="pkg_price" type="number" size="5" min="0" value="3.69">

type="number" is a new input type in html5. If a browser doesn't follow the html5 type="number" spec yet, it falls back to treat it as regular type="text" field.

However, webkit browsers see <input name="pkg_price" type="number" size="5" min="0" value="3.69"> and only allow integer input. "3.69" is invalid in their view for this field. I need to add step="0.01" or step="any" or they just assume that step="1".

Safari 5 not recognizing submit button on forms.

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.