1
Good morning, I have a problem on my page.
I created a Form with a field for comment. When clicking the button it "should" call the function but does not call.
function gravaobs(pag_pedido, obs_boleto, stats)
{
if (obs_boleto.length == 0)
{
alert('Por favor, preencha a observação');
document.formobs.observacao.focus();
return;
}
else
{
var param = {'pag_pedido': pag_pedido, 'obs_boleto': obs_boleto, 'status': stats};
OpenWindowWithPost('tela_de_tratamento.php', '', 'NewFile1', param);
}
}
<form id="formobs" name="formobs">
<table style='width: 1220px;'>
<tr>
<td align='center' style='padding:5px 0 10px 0; font: 12pt Trebuchet MS; color: #00471A; margin:0 auto;'> Inserir Obs.:</td>
<td align='center' style='padding:5px 0 10px 0; font: 12pt Trebuchet MS; color: #00471A; margin:0 auto;'><input style='width: 975px;' id='observacao' name='observacao' type='text' maxlength='250' tabindex='4' size='137'/></td>
<td style='font-size:14px; text-align:left;'><br/></td>
<td align='center'><p class='botao'><a href='#' title='Gerar' onclick="javascript:gravaobs(<?php print $pag_pedido; ?>, document.formobs.observacao.value, <?php print $status; ?>);"></a></p></td>
</tr>
</table>
</form>
All variables are normal and even (by placing php echo variables) they appear normal, but I don’t know why it doesn’t work
Can someone help me?
Writes
onClick
all with small letter. So:onclick
– Sergio
I tried, and I got no results
– Felipe Song
This function is inside the <head> <script> tag and the Browser does not give any error, in the page link appears # after the page name but nothing happens, nor the message if the field is empty. The screen in the case is just the field to type and an image of a button, nothing more.
– Felipe Song