Olá tudo bem?
Tenho este formulário:
<form method = "post" action = "/scv/cad/marca" name = "formMarca"
onSubmit = 'return validaCampo([txtNome], ["Marca"])' >
<table>
<tr>
<td> <strong> Nome </strong> </td>
<td> <input type = "text" name = "txtNome" size = "40" maxlength = "40"
<% if ((request.getParameter("marNome") != null) ) { %>
value = '<%=request.getParameter("marNome")%>'>
<%}%>
</td>
</tr>
</table>
<p>
<input type = "button" name = btNovo value = Novo onClick = novaPagina()>
<input type = "submit" name = "<%=situacao%>" value = "<%=nomeBotao%>" onClick = mudaAction(1) >
<input type = "submit" name = "del" value = "Excluir" onClick = mudaAction(1) >
<input type = "hidden" value = <%=codMarca%> name = "codMarca">
<input type = "submit" name = "Imprimir" value = "Imprimir" onClick = mudaAction(0)>
<a href = '/scv/jsp/Pesquisa.jsp?<%="tabela=" + "Marca"%>'><strong>Pesquisar marca</strong> </a>
</form>
E tenho está função javascript
function novaPagina()
{
location.href= "/scv/jsp/Marca.jsp";
}
Problema:
Depois de realizar uma pesquisa eu jogo o valor de retorno da pesquisa dentro do meu formulário JSP.
<% if ((request.getParameter("marNome") != null) ) { %>
value = '<%=request.getParameter("marNome")%>'>
<%}%>
Até aqui tudo bem!
Entretanto, quando coloco um botão submit neste formulario, ele não limpa o campo
<td> <input type = "text" name = "txtNome" size = "40" maxlength = "40"
Então fiz uma função chamada “novaPagina()” que faz uma nova chamada para a mesma página JSP.
O QUE PRECISO ?
O que há de errado aqui quando clico em um botão reset? Por que ele não limpa a caixa de texto
<% if ((request.getParameter("marNome") != null) ) { %>
value = '<%=request.getParameter("marNome")%>'>
<%}%>
Obrigado por sua atenção!


