I am new to this forum, Hi everybody
I am trying to write a greasemonkey javascript code to automate submission of a form
the form has no name so I used this code to identify it in the array of forms and submit:
document.getElementsByTagName('form')[1].submit();
it ALMOST works but the problem is that the form has 2 buttons (see below) and my code clicks on the first one while I want to click on the second one;
question: how do I identify the second button?
(it has no "id" or "name", only a "value"; there's a "class" in the TD tag before if it can help)
Thanks
Claudio
-----
<td class="license2">
<input type='submit' value="Save" class="btn" onclick='document.getElementById("submit_elem").value="save";' />
</td>
<td class="license3">
<input type='submit' value="Submit" class="btn" onclick='document.getElementById("submit_elem").value="submit";'/>
</td>
I am trying to write a greasemonkey javascript code to automate submission of a form
the form has no name so I used this code to identify it in the array of forms and submit:
document.getElementsByTagName('form')[1].submit();
it ALMOST works but the problem is that the form has 2 buttons (see below) and my code clicks on the first one while I want to click on the second one;
question: how do I identify the second button?
(it has no "id" or "name", only a "value"; there's a "class" in the TD tag before if it can help)
Thanks
Claudio
-----
<td class="license2">
<input type='submit' value="Save" class="btn" onclick='document.getElementById("submit_elem").value="save";' />
</td>
<td class="license3">
<input type='submit' value="Submit" class="btn" onclick='document.getElementById("submit_elem").value="submit";'/>
</td>