Form doesn't submit on Firefox - forms

<table width=100% cellspacing=0 cellpadding=0 class="form_table">
<form name="suggestion_box" action="suggestion_box.php" method=post>
<input type="hidden" name="form_submit" value="1">
<tr>
<td width=40% align=right valign=top class="form_label_cell">
<b class="form_label">
First Name<br>
</b>
</td>
</table>
<br>
<input type="image" src="button_submit.gif" alt="Submit" class="input_gfx">
<input type="hidden" name="form_submit" value="1">
<br>
</form>
</table>
This is my form, I don't know why that doesn't work with Firefox, can you help me?
I've been reading hundreds of answers since weeks ago, but I couldn't make it work.

1) You can't place your form within the table like that.
2) You are closing your table (</table>) twice.
3) You never closed your row (</tr>).
Try this simplified code instead:
<form name="suggestion_box" action="suggestion_box.php" method=post>
<table width="100%" cellspacing="0" cellpadding="0" class="form_table">
<tr>
<td>
<input type="hidden" name="form_submit" value="1">
</td>
</tr>
<tr>
<td>
<b class="form_label">
First Name
</b>
</td>
</tr>
<tr>
<td>
<input type="submit" src="button_submit.gif" alt="Submit" class="input_gfx">
</td>
</tr>
</table>
</form>

You have to specify a name for your image input field.
<input type="image" name="yourimage" src="button_submit.gif" alt="Submit" class="input_gfx">
You can access the x/y values using the POST variables yourimage.x / yourimage.y (or in PHP yourimage_x, yourimage_y).

I have had problem with forms and inputs which don't have id's, Try giving id's to the form and form elements and add type="submit" to your submit button.

Related

I have this code, when submited the form dont refresh, someone know how refresh after submit on october cms?

<form data-request="onSend" data-request-update="'{{ __SELF__}}::attbanco': '#banco' "
data-request-flash >
<table>
<tr>
<td>Nome: </td> <td ><input type="text" id="nome" name="nome"></td>
</tr>
<tr>
<td>Idade: </td> <td ><input type="number" id="idade" name="idade" value="{{usuario.idade}}"></td>
</tr>
<tr>
<td>Telefone: </td> <td ><input type="text" id="telefone" name="telefone" value="{{usuario.telefone}}"></td>
</tr>
</table>
<button type="submit" >Enviar</button>
<input type="hidden" value="{{usuario.id}}" name="id">
this code work, saves the values on database, but i need manually refresh page to see the result on my
screen, someone know how refresh after submit?
Please, explain most simple possible, i am newbie
The best way to do what you want is to put the form in a partial and update it when the form is submitted.
Replace your form with this:
<div id="specialForm">
{% partial __SELF__~"::specialForm" %}
</div>
Create a partial to describe the form; I used specialForm. It should reload the form and clear the content.
<form data-request="onSend" data-request-update="'{{ __SELF__}}::attbanco': '#banco', '{{ __SELF__ }}::specialForm': '#specialForm' "
data-request-flash >
<table>
<tr>
<td>Nome: </td> <td ><input type="text" id="nome" name="nome"></td>
</tr>
<tr>
<td>Idade: </td> <td ><input type="number" id="idade" name="idade" value="{{usuario.idade}}"></td>
</tr>
<tr>
<td>Telefone: </td> <td ><input type="text" id="telefone" name="telefone" value="{{usuario.telefone}}"></td>
</tr>
</table>
<button type="submit" >Enviar</button>
<input type="hidden" value="{{usuario.id}}" name="id">
</form>

To Get Text From A Locater Using Selenium IDE

<br>
<br>
To add new COT click on "Add New COT"
<div class="stepandbutton">
<div class="globalbuttoncell">
<a class="buttonlink blockpage" onclick="javascript:addnewcot();" href="#">Add New COT</a>
</div>
</div>
<input id="ComingFromForm" type="hidden" value="ComingFromForm" name="ComingFromForm">
<input id="priorCOT" type="hidden" value="" name="priorCOT">
<input id="rtncode" type="hidden" value="false" name="rtncode">
<input id="refresh" type="hidden" value="NO" name="refresh">
<input id="PDate" type="hidden" value="" name="PDate">
<table>
<thead>
<tr>
<th align="center"> *Trade Class</th>
<th align="center">*Description</th>
<th>Category </th>
<th>Exclude from AMP</th>
<th>Exclude from AMP 5i</th>
<th>Exclude from ASP</th>
<th>Exclude from BP</th>
<th>Exclude from NFAMP </th>
<th>Exclude from Texas </th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td align="center">
<input id="COT" class="data" type="text" value="" style="width:100px;" name="COT">
</td>
<td align="center">
<input id="Desc" class="data" type="text" value="" style="width:250px;" name="Desc">
</td>
<td align="center">
<select id="COTCategory" class="data small" name="COTCategory">
</td>
<td align="center">
<td align="center">
<td align="center">
<td align="center">
<td align="center">
<td align="center">
</tr>
</tbody>
</table>
</form>
<br>
<br>
I need to verify only ""To add new COT click on "Add New COT""" which is in the 3rd line is present.I have tried with //br[contains(text(),"To add new COT click on "Add New COT"")]. But it showing error that locator is not found.Please suggest another ways to verify it.
This is ugly but would "work":
<tr>
<td>verifyText</td>
<td>//body</td>
<td>*To add new COT click on "Add New COT"*</td>
</tr>
But as the commenter above mentions you don't want the br element. What you want to locate on is the element that you didn't provide that lives ABOVE the code you attached to. That would be best.

Subtract Two Text/Integer Form Fields in Coldfusion MX7

Pardon me while I probably over-complicate the uber simple, but I'm trying to subtract two text/integer fields in a form. However, I keep getting a 'variable TXTMILEAGE2 is undefined' error. What am I missing/obviously doing wrong?
Code snippit:
<table>
<tr>
<td><label for="txtmileage1">
<div align="right">Start Mileage:</div></label></td>
<td><cfinput type="text" name="txtmileage1" message="Enter your start mileage."
required="yes" class="box" id="txtmileage1" tabindex="2" validate="integer" />
</td>
</tr>
<tr>
<td><label for="txtmileage2">
<div align="right">End Mileage:</div></label></td>
<td><cfinput type="text" name="txtmileage2" message="Enter your ending mileage."
required="yes" class="box" id="txtmileage2" tabindex="3" validate="integer" />
</td>
</tr>
<tr>
<td><label for="txtMileage3">
<div align="right">Miles Driven:</div></label></td>
<td><cfset txtmileage3 = txtmileage2 - txtmileage1>
<cfinput type="text" name="txtmileage3" value="#txtmileage3#" disabled="true"
class="box" id="txtmileage3" tabindex="4"/>
</td>
</tr>
</table>
Also, this page is being run on a legacy server that hasn't been updated since 2005. Hence the old MX7.

How to find tag in table structure using jQuery

I have the following html:
<table>
<tr>
<td>
<input type="button" id="btnAdd" value="Add" />
<input type="hidden" id="hdnID" value='209' class="hdn" />
</td>
</tr>
<tr>
<td>
<input type="button" id="btnAdd" value="Add" />
<input type="hidden" id="hdnID" value='210' class="hdn" />
</td>
</tr>
<tr>
<td>
<input type="button" id="btnAdd" value="Add" />
<input type="hidden" id="hdnID" value='211' class="hdn" />
</td>
</tr>
</table>
I have a jQuery click event for the add buttons.
$("#btnAdd").click(function ($e) {
// Need selector here that can find the hidden field (see above) that is found
// in the same td as the button that was clicked. For example, if the Add button
// in the 2nd row was clicked then I need to find the hidden input that has
// the value of '210'.
// Doesn't work... not sure why
var hdn = $(this).siblings().next();
});
Thanks in advance for helping me through a thick moment...
Maybe something like this would work?
("#btnAdd").click(function ($e) {
var hdn = $(this).parent().next().children('td input');
});

How to identify in table an input (check-box) followed by a text in <td>?

I have to identify the path of check boxes in a row from a table using the text preceding them. The problem is that the text is inserted in a 'td'.
The code is following:
<tr class="bz_row_even">
<td align="center">
<input type="checkbox"
name="email-0-10"
value="1"
checked>
</td>
<td align="center">
<input type="checkbox"
name="email-1-10"
value="1"
checked>
</td>
<td align="center">
<input type="checkbox"
name="email-2-10"
value="1"
checked>
</td>
<td align="center">
<input type="checkbox"
name="email-3-10"
value="1"
checked>
</td>
<td>A new bug is created
</td>
</tr></code></pre>
In this example I have 4 check-boxer for a row. My query should be with a count to check the check-boxes in turn.
Could somebody help me with the path of check-boxes?
Thank you in advance
If you don't use Se-IDE, this becomes much easier. Here I just add the path to a list, but could use get_attribute or similar on the element that is been used.
paths = []
for checkbox in range(se.get_css_count("css=#bz_row_even input"):
paths.append("css=#bz_row_even input[%d]" % checkbox)
Unless I completely misunderstand your question