Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

reset button  RSS feed

 
Mimi Cha
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
for my login page, i have a reset button to clearup the loginname and password fields.

the reset button doesn't work,if the submit button is clicked.
In this case, the user can not logon and the errormessage occurs. In the loginname field the old value (the last value before i click the logon button) still exists. When i click the reset button, Nothing changes. When i fill a new value in the loginname field and click reset, the last value before i click the logon button occurs again.

in the userBean i add the methode

public void reset(){
setName("");
setPassword("");
}
in jsp site:
<h:commandButton id="reset" value="#{txt.reset}" action="#{user.reset}"/>

Can someone tell me why?
 
Mimi Cha
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i have solved the problem by myself.
i just set the value of loginname="" by submitbutton.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!