I have this form:
<form id="br" method="post" action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]) ?>">
<table>
<tr>
<td>Report Title:*</td> <td><input name="title" type="text" required placeholder="The bug that you want to report" size="50" maxlength="35" /></td><td></td>
</tr><br />
<tr>
<td>Reporter:*</td> <td><input name="user" type="text" required class="username" placeholder="Your name" size="50" maxlength="35"></td><td><input type="checkbox" name="anonymous" id="cb" /><label for="cb">Report anonymously</label></td>
</tr>
<tr>
<td style="vertical-align: top;">Report summary:* </td> <td><textarea name="sum" cols="39" rows="15" required id="sum"></textarea></td></td><td></td>
</tr>
<tr><td style="font-size:12px;"><em>* - required field</em></td><td></td><td></td></tr>
</table>
<br />
<div class="submitform"></div>
<br />
</form>
But the required fields won't validate, even if I put the required attribute to them. It would immediately submit the form without validating anymore...
ok , i got it
<div class="submitform"></div>
It should be
<input type="submit" name="submit" />
HI i want to validate an input type=email field with a submit button.
I have two form element in the page. And i am opening a div(divForgotPassword) as a modal.
But the required attribute is not working inside the modal .
Below is my my code
<form id="form1" runat="server">
//some elements
<form id="form2" action="javascript:RetrievePassword();">
<div id="divForgotPassword" style="display:none" title="Forgot password">
<table>
<tr>
<td>
<asp:Label ID="lblForgotPassword" runat="server" Text="Email"></asp:Label>:
</td>
<td>
<input type="email" required="required" id="txtForgotEmail" />
</td>
</tr>
<tr>
<td>
<input type="submit" style="background-image:url('Images/buttons/btn_send.png')" id="btnSend" />
</td>
</tr>
</table>
</div>
</form>
<form id="form2" action="javascript:RetrievePassword();">
<div id="divForgotPassword" title="Forgot password">
<table>
<tr>
<td>
<label for="txtForgotEmail">
EMAIL : </label>
<td>
<input type="email" required="required" id="txtForgotEmail" />
</td>
</tr>
<tr>
<td>
<input type="submit" style="background-image:url('Images/buttons/btn_send.png')" id="btnSend" />
</td>
</tr>
</table>
</div>
please find this demo DEMO
i have one form and i want send data when i have disable input.
is way for this.
my code is :
<form method="post" action="">
<table class="tbl_wheader" style="width: 200px;">
<tbody>
<tr class="even">
<td>
state
</td>
<td>
<input type="text" id="state_id" name="state_id" disabled="">
</td>
</tr>
<tr class="even">
<td>
</td>
<td>
<input type="submit" value="ok" name="addschool">
</td>
</tr>
</tbody>
thanks.
you can store your data in hidden input
<input type="text" name="state_id" disabled="disabled" value="value" />
<input type="hidden" name="state_id" value="same value" />
or you can use readonly attribute
<input type="text" name="state_id" readonly value="value" />
I'm working on some styling in Wordpress with WP e-Commerce and in the checkout page there is a table in which the table headers are all getting left justified and not becoming the width of each of their columns. When I try the HTML code without the CSS it works fairly well but there is so much CSS being applied that I cannot figure out what is causing it, exactly.
Please see the HTML code in question below.
Any thoughts on how to find the culprit?
<table class="checkout_cart">
<tbody>
<tr class="header">
<th colspan="2">Product</th>
<th>Quantity</th>
<th>Price</th>
<th>Total</th>
<th> </th>
</tr>
<tr class="product_row product_row_0 alt">
<td class="firstcol wpsc_product_image wpsc_product_image_0"> <img src="31x31.jpg" alt="Spreading the Light" title="Light" class="product_image"> </td>
<td class="wpsc_product_name wpsc_product_name_0"> Spreading the Light </td>
<td class="wpsc_product_quantity wpsc_product_quantity_0">
<form action="/store/checkout/" method="post" class="adjustform qty">
<input type="text" name="quantity" size="2" value="1">
<input type="hidden" name="key" value="0">
<input type="hidden" name="wpsc_update_quantity" value="true">
<input type="submit" value="Update" name="submit">
</form>
</td>
<td><span class="pricedisplay">$5.00</span></td>
<td class="wpsc_product_price wpsc_product_price_0"><span class="pricedisplay"><span class="pricedisplay">$5.00</span></span></td>
<td class="wpsc_product_remove wpsc_product_remove_0">
<form action="/store/checkout/" method="post" class="adjustform remove">
<input type="hidden" name="quantity" value="0">
<input type="hidden" name="key" value="0">
<input type="hidden" name="wpsc_update_quantity" value="true">
<input type="submit" value="Remove" name="submit">
</form>
</td>
</tr>
</tbody>
</table>
You have 5 headers (th), but 6 colums below (td)
This form code is working in Mozilla and Chrome, but in Internet Explorer it is not working.
<form method="post" action="logincheck.php" >
<span class="meta">
<table>
</span>
<tr>
<td>
<span class="meta">
<label >Username </label>
</span>
<label>
</td>
<td> <input name="username" type="text" />
</label>
</form>
</td>
</tr>
<tr>
<td> <label ><span class="meta">Password</td>
<td>
<input name="password" type="password" />
</span>
</label>
</td>
</tr>
<tr>
<td>
<span class="meta">
</span>
<label>
<input type="submit" name="Submit" value="Submit" class="submit"/>
</label>
</td>
</tr>
</table>
</form>
You have a number of HTML errors, most important being an extra </form> tag shortly after the first <input>. That means the second input and the submit button are outside the form, so it won't work. Firefox and Chrome are being a bit more forgiving here it seems.
Fix your HTML and the form should work fine.
You have errors that automated QA tools can detect
<form method="post" action="logincheck.php">
<label for="username">Username</label>
<input name="username" type="text" />
<label for="password">Password</label>
<input name="password" type="password" />
<input type="submit" name="Submit" value="Submit" class="submit" />
</form>
The correct code for this form must look like this.
You do not need the table, you can style the form with easily with CSS over selecting the label & input fields
<span class="meta">
<table>
</span>
The nesting is wrong. In fact, there's a lot more wrong. Try googling what <label> does exactly, and what <span> does and when you want to use it. You probably want something like this:
<form method="post" action="logincheck.php" >
<table>
<tr>
<td><label class="meta">Username </label></td>
<td><input name="username" type="text" /></td>
</tr>
<tr>
<td><label class="meta">Password</td>
<td><input name="password" type="password" /></td>
</tr>
<tr>
<td colspan="2"><input type="submit" name="Submit" value="Submit" class="submit"></td>
</tr>
</table>
</form>
Here is a version without span tags, label and extra </form> in the middle of the table before submit button.
I guess, you added those by hands in plain text editors.
<form method="post" action="logincheck.php">
<table>
<tr>
<td>
Username
</td>
<td>
<input name="username" type="text" />
</td>
</tr>
<tr>
<td>
Password
</td>
<td>
<input name="password" type="password" />
</td>
</tr>
<tr>
<td>
<input type="submit" name="Submit" value="Submit" class="submit" />
</td>
</tr>
</table>
</form>
One first error is:
<span class="meta">
<table>
</span>
But you have many errors.
Open and close tags as you will do with parenthesis. No horse riding. HTML and now XHTML need you to be a little bit more conscientious.
usefull tool:
http://giminik.developpez.com/xhtml/
http://validator.w3.org/