0
我正在使用jcryption进行加密form.It正常工作,如果我使用提交按钮的形式。相反,如果我使用按钮并手动提交表单,我的jcryption方法不会被调用。jcryption表单提交无法使用按钮单击
below is my code
<html>
<head>
<script type="text/javascript">
$(document).ready(function() {
$("#login").bind('click', function(){
document.authenticatorform.username.value=$("#username").val();
document.authenticatorform.password.value=$("#password").val();
alert('outer hello');
$("#authenticatorform").jCryption({
getKeysURL:"<%=request.getContextPath()%>/keypairrequest",
beforeEncryption:function() {
alert('inner hello');
document.authenticatorform.submit()
return true; },
encryptionFinished:function(encryptedString, objectLength) {return true;}
});
});
});
</script>
<body>
<form:form method="post" action="login.htm" name="authenticatorform" id="authenticatorform">
<input type="hidden" name="username"/>
<input type="hidden" name="password"/>
</form:form>
<input type="button" id="login"/>
</body>
</html>
在代码中只有外部警报正在打印。
是否可以在提交按钮之外调用jcryption?
任何帮助将不胜感激!!!!!
@S Dhanissh尝试,代码去绑定块内,但不是要求jcryption方法 – Madhesh