java判断文本框中有输入_java js 怎么判断文本框输入的内容

this.textField=newccui.TextField();//定义一个文本框this.textField.setMaxLengthEnabled(true);//设置电脑长度的使用this.textField.setMaxLength(10);//文本框内可输入多少东西th...

this.textField = new ccui.TextField(); //定义一个文本框

this.textField.setMaxLengthEnabled(true); //设置电脑长度的使用

this.textField.setMaxLength(10); //文本框内可输入多少东西

this.textField.setTouchEnabled(true); //设置触摸启用

this.textField.fontName = "Arial"; //字体

this.textField.fontSize = 40; //字体大小

this.textField.placeHolder = "账号"; //文本框内背景字

this.textField.setTextColor(0,1,0); //字体颜色

this.textField.x = this.frame.width / 2; //X轴坐标

this.textField.y = this.frame.height / 2; //Y轴坐标

this.textField.addEventListener(this.textFieldEvent, this); //监听事件 文本框事件

this.frame.addChild(this.textField);

switch (type) {

case ccui.Widget.TOUCH_ENDED:

cc.log("点击了登录");

if() {

cc.log("成功进入游戏");

this.frame.setVisible(false);

cc.director.runScene(new xxy());

}

else{

cc.log("账号密码错误");

}

break;

default:

break;

};

我定义了文本框,现在想点击按钮的时候判断用户输入的内容为123456,才可以成功进入到游戏,if的判断条件是什么?新手求告知啊!

展开

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值