1
I need to pass as parameter the content that is in a textbox
, in the onclick
of a button. How can I do this?
This is the HTML code:
<div id="popup">
<table width="300" height="160">
<tr>
<td colspan="3" height="20" style="text-align:right"><input type="submit" value="Fechar X" id="FecharModal" onclick="fecharDialog()" /></a></td>
</tr>
<tr>
<td colspan="3" style="text-align: center; font-weight: bold; font-size:15px"><div id="texto"><p></p></div></td>
</tr>
<tr>
<td height="30" style="text-align:center"><input type="submit" value="Sim" id="ValidaSim" onclick="ValidaSim()" /></td>
<td height="30" style="text-align:center" colspan="2"><input type="submit" value="Não" id="ValidaNao" onclick="ValidaNao()" /></td>
</tr>
<tr>
<td height="30" style="text-align:center; display:none"><input type="text" id="txtValid" /></td>
<td height="30" style="text-align: center; display: none"><input type="text" id="txtDrop" /></td>
<td height="30" style="text-align: center; display: none"><input type="text" id="txtMatricula" /></td>
</tr>
</table>
In Validasim onclick input I need to pass the text that is in textbox
txtValid as parameter. Already in the onclick of the Validate input I do not need to pass the text of all textbox
below, as parameters.
<td height="30" style="text-align:center; display:none"><input type="text" id="txtValid" /></td>
<td height="30" style="text-align: center; display: none"><input type="text" id="txtDrop" /></td>
<td height="30" style="text-align: center; display: none"><input type="text" id="txtMatricula" /></td>
Go where?
– Guerra
A warning, it is not a good practice to insert the style tag inside the element, the css standards ask for it to be located in a file . css
– Lucas