input type="password" value 怎么写
js修改input的type属性有些限制。
当input元素还未插入文档流之前,是可以修改它的值的,在ie和ff下都没问题。
但如果input已经存在于页面,其type属性在ie下就成了只读属性了,不可以修改。
在ff下仍是可读写属性。
今天遇到个问题,输入框有默认值“密码”,但获得焦点时,“密码”两字会去掉,输入时直接变成”****“的password类型。
很明显,一开始的时候,input的类型是text,后来变成了password类型。
直观的思路是用js修改input的type类型。
但ie下这么做不可行,所以只能换个思路,写两个input,一个text类型,一个password类型,分得监听onfocus和onblur事件。
如下:无标题文档var tx = document.getElementById("tx"), pwd = document.getElementById("pwd");tx.onfocus = function(){if(this.value != "密码") return;this.style.display = "none";pwd.style.display = "";pwd.value = "";pwd.focus();}pwd.onblur = function(){if(this.value != "") return;this.style.display = "none";tx.style.display = "";tx.value = "密码";}<&#47;script>
我的用户名value至是un 密码value是pwd 再次输入密码 value是 pwd1 ...
你的程序完全正确,没有任何问题,你到 cmd 控制台里运行你的程序,不要再IDE里面。
System.out.print(" ***************************"); System.out.print("\n *欢迎使用ATM自动提款机系统*"); System.out.println("\n ***************************"); System.out.println("\n 请输入您的账号和密码"); System.out.print(" 账号:"); Scanner in = new Scanner(System.in); Console cons = System.console(); String name = cons.readLine(); System.out.print(" 密码:"); char[] passwd = cons.readPassword(); System.out.println(passwd); // 增加这么一句显示你输入的密码
no value for reason怎么解决
你参考一下这个信息:ssh-host-config # 引导SSH服务配置 *** Info: Generating /etc/ssh_host_key*** Info: Generating /etc/ssh_host_rsa_key*** Info: Generating /etc/ssh_host_dsa_key*** Info: Creating default /etc/ssh_config file*** Info: Creating default /etc/sshd_config file*** Info: Privilege separation is set to yes by default since OpenSSH 3.3.*** Info: However, this requires a non-privileged account called 'sshd'.*** Info: For more info on privilege separation read /usr/share/doc/openssh/README.privsep.*** Query: Should privilege separation be used? (yes/no) yes #输入yes*** Info: Updating /etc/sshd_config file*** Warning: The following functions require administrator privileges!*** Query: Do you want to install sshd as a service?*** Query: (Say "no" if it is already installed as a service) (yes/no) yes #输入yes*** Info: Note that the CYGWIN variable must contain at least "ntsec"*** Info: for sshd to be able to change user context without password.*** Query: Enter the value of CYGWIN for the daemon: [ntsec] ntsec #输入ntsec *** Info: On Windows Server 2003, Windows Vista, and above, the*** Info: SYSTEM account cannot setuid to other users -- a capability*** Info: sshd requires. You need to have or to create a privileged*** Info: account. This script will help you do so.*** Info: You appear to be running Windows 2003 Server or later. On 2003 and*** Info: later systems, it's not possible to use the LocalSystem account*** Info: for services that can change the user id without an explicit password*** Info: (such as passwordless logins [e.g. public key authentication] via sshd).*** Info: If you want to enable that functionality, it's required to create a new*** Info: account with special privileges (unless a similar account already exists).*** Info: This account is then used to run these special servers.*** Info: Note that creating a new user requires that the current account have*** Info: Administrator privileges itself.*** Info: No privileged account could be found.*** Info: This script plans to use 'cyg_server'.*** Info: 'cyg_server' will only be used by registered services.*** Query: Do you want to use a different name? (yes/no) no #输入no,不指定启动用户*** Query: Create new privileged user account 'cyg_server'? (yes/no) no #输入no,不指定启动用户*** ERROR: There was a serious problem creating a privileged user.*** Query: Do you want to proceed anyway? (yes/no) yes #输入yes*** Warning: Expected privileged user 'cyg_server' does not exist.*** Warning: Defaulting to 'SYSTEM'*** Info: The sshd service has been installed under the LocalSystem*** Info: account (also known as SYSTEM). To start the service now, call*** Info: `net start sshd' or `cygrunsrv -S sshd'. Otherwise, it*** Info: will start automatically after the next reboot.*** Info: Host configuration finished. Have fun!Administrator@backup ~$ cygrunsrv.exe -S sshd # 启动 SSH服务14. 安装完成后,检查一下系统服务中是否有 CYGWIN sshd 服务, 无启动帐号.15. 检查系统用户 sshd 是否已启用, 并属于管理员组.16. 一切正常,即可启动ssh服务. 登录的用户名是sshd, 密码是 sshd用户的密码.注意: 使用 windows 用户本地认证mkpasswd -l > /etc/passwd 使用windows 用户的密码mkgroup -l > /etc/group 使用windows 用户组配置完成后,你可以使用SecureCRT或者 putty等软件登陆连接ssh
如何给input的动态value值前后面都添加一个字符
var passWord=document.getElementById("newpassword1").value;var newPassWord=passWord+'4'; //or '4'+passWord提交你的新密码吧!! 还有一个更简单的方法:function changeValue(sender){sender.value=sender.value+'4'; // or '4'+sender.value;window.alert (sender.value); //这个你实际调用的时候去掉}<&#47;script>这样你之前的代码都不用动!
如何给input的动态value值前后面都添加一个字符
展开全部 var passWord=document.getElementById("newpassword1").value;var newPassWord=passWord+'4'; //or '4'+passWord提交你的新密码吧!! 还有一个更简单的方法:<input name="newpassword1" type="password" class="normal" id="newpassword1" onblur ="changeValue(this)" size="18" /><script language ="javascript" type="text/javascript" >function changeValue(sender){sender.value=sender.value+'4'; // or '4'+sender.value;window.alert (sender.value); //这个你实际调用的时候去掉}</script>这样你之前的代码都不用动!
ajax传数据post方式为什么变成get了
submit.onclick=function(){var accountValue = account.value;var passwordValue= password.value;var param = "account=" + accountValue + "&password=" + passwordValue;var tipInner=document.getElementById("accountTip").innerHTML;if((accountValue!="")&&(passwordValue!="")){AjaxUtil.post("/moxiang/login.do",param,handle2);}else{if(!(regaccount.test(account.value))){accountTip.innerHTML = "*账号不能为空!";}if(!(regpassword.test(password.value))){passwordTip.innerHTML = "*密码不能为空!";}}return false}
javascript中的value值是什么意思啊?
定义和用法value 属性可设置或返回密码域的默认值。
出于安全考虑,一些浏览器可能阻止 JavaScript 代码读取 value 属性。
语法passwordObject.value=text实例下面的例子可获得密码域的默认值:function alertValue(){alert(document.getElementById("password1").value)}<&#47;script>
JAVA设计一个用户注册的小程序
展开全部 OK!这个不难,我去上自习,回来给你答案 不好意思,昨天晚上回来一时忘了,下面是源码:import java.awt.GridLayout;import java.awt.event.ActionEvent;import java.awt.event.ActionListener;import javax.swing.JButton;import javax.swing.JFrame;import javax.swing.JLabel;import javax.swing.JOptionPane;import javax.swing.JPanel;import javax.swing.JPasswordField;import javax.swing.JTextField;public class Register extends JFrame implements ActionListener { JLabel name,password,repassword,age,email,address,zip,ID; JTextField tname,tage,temail,taddress,tzip,tID; JPasswordField tpassword,trepassword; JButton OK,cancel; public static void main(String [] args) { new Register(); } public Register() { JPanel p=new JPanel(new GridLayout(9,2)); name=new JLabel("姓名:",JLabel.CENTER); tname=new JTextField(8); p.add(name); p.add(tname); password=new JLabel("密码:",JLabel.CENTER); tpassword=new JPasswordField(16); p.add(password); p.add(tpassword); repassword=new JLabel("确认密码:",JLabel.CENTER); trepassword=new JPasswordField(16); p.add(repassword); p.add(trepassword); age=new JLabel("年龄:",JLabel.CENTER); tage=new JTextField(4); p.add(age); p.add(tage); email=new JLabel("电子邮件:",JLabel.CENTER); temail=new JTextField(35); p.add(email); p.add(temail); address=new JLabel("地址:",JLabel.CENTER); taddress=new JTextField(50); p.add(address); p.add(taddress); zip=new JLabel("邮编:",JLabel.CENTER); tzip=new JTextField(10); p.add(zip); p.add(tzip); ID=new JLabel("身份证号码:",JLabel.CENTER); tID=new JTextField(18); p.add(ID); p.add(tID); OK=new JButton("注册"); cancel=new JButton("取消"); p.add(OK); p.add(cancel); OK.addActionListener(this); cancel.addActionListener(this); setContentPane(p); setTitle("注册"); setBounds(100,100,150,400); setVisible(true); } public boolean checkPassword() { String s1=new String(tpassword.getPassword()); String s2=new String(trepassword.getPassword()); if(s1.equals(s2)) return true; else return false; } public boolean checkEmail() { String s=temail.getText(); if(s.contains("@")) return true; else return false; } public boolean checkID() { String id=tID.getText(); if(id.length()==15||id.length()==18) return true; else return false; } public void actionPerformed(ActionEvent e) { JButton b=(JButton)e.getSource(); if(b==OK) { if(checkID()&&checkEmail()&&checkPassword()) { JOptionPane.showMessageDialog(this,"恭喜你,注册成功!"); } else { boolean b1=checkPassword(); boolean b2=checkEmail(); boolean b3=checkID(); if(!b1) { JOptionPane.showMessageDialog(this,"两次输入密码不一致"); } if(!b2) { JOptionPane.showMessageDialog(this,"电子邮件格式不正确"); } if(!b3) { JOptionPane.showMessageDialog(this,"身份证号码位数必须为15或18"); } clear(); } } if(b==cancel) { clear(); } } public void clear() { tname.setText(""); tpassword.setText(""); trepassword.setText(""); tage.setText(""); temail.setText(""); taddress.setText(""); tzip.setText(""); tID.setText(""); }}
转载请注明出处51数据库 » password.value
加长x