Posted on 2007-08-03 17:14
love1563 閱讀(854)
評論(0) 編輯 收藏 所屬分類:
JSP/Servlets/JSF
<html>
<head>
<script language="javascript">
?//獲取文本密碼框的值
?function getTextValue() {
??//alert("document.forms.length :" + document.forms.length);
??//alert(document.forms[0].oText.value);
??appendHidden(document.Myform,"appendText","appendText");
?}
?
?function getPasswordValue() {
??//alert(document.forms[0].oPswd.value)
?}
?function appendHidden(destForm, name, value) {
?//?alert("thisPath");
??var newHidden = document.createElement("input");
??//newHidden.type = "hidden";
??newHidden.name = name;
??newHidden.value = value;
??destForm.appendChild(newHidden);
?}
</script>
</head>
<!--Text控件相關(guān)Script-->
<body>
<form name="Myform">
<input type="text" name="oText" onblur = "getTextValue();">
<input type="password" name="oPswd" onblur = "getPasswordValue();">
</form>
</body>
</html>