java - While using struts html tags, How do I get the value of a textbox using its property attribute? Is there any other way to get the value? -
function validate(){ var username = document.getelementbyproperty("username").value; var password = document.getelementbyproperty("password").value; if((username == null ||username =='') || (password == null||password=='')){ x=document.getelementbyid("error"); x.innerhtml = "username or password cannot blank"; else{ document.getelementbyid("loginform").submit(); } <form id="loginform" action="login.do" method="post"> username:<html:text property="username"></html:text> password:<html:password property="password"></html:password> <html:button onclick="validate()"></html:button> </form> the above code not working , unable values in textbox validation... please me out in issue...
function validate(){ var username = document.getelementbyid("username").value; var password = document.getelementbyid("password").value; } <form id="loginform" action="login.do" method="post"> username:<html:text property="username" styleid="username"></html:text> password:<html:password property="password" styleid="password"></html:password> <html:button onclick="validate()"></html:button> </form>
Comments
Post a Comment