首先我的英语不是很好,但是我会尽力而为。
我想要一个txt字段和一个指向下一页的按钮,但是文本字段必须为文本。
如果该字段为空,则该按钮不应转到另一页
希望有人能理解我
thnx
答案 0 :(得分:1)
有帮助吗?
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Container(
margin: EdgeInsets.only(
right: 16
),
child: ClipRRect(
borderRadius: BorderRadius.circular(16),
child: Image.asset(
'assets/photo.jpg',
width: 160
),
),
),
Expanded(
child: Container(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Container(
margin: EdgeInsets.only(bottom: 16),
child: Text(
"Wonderful haircut",
style: TextStyle(
fontSize: 20
),
)
),
Container(
child: Text(
"An undercut is typecally a cut done with clippers in the back.",
style: TextStyle(
fontSize: 18
),
),
),
Container(
margin: EdgeInsets.only(top: 30),
padding: EdgeInsets.symmetric(vertical: 6, horizontal: 16),
decoration: BoxDecoration(
color: Colors.red,
borderRadius: BorderRadius.circular(16)
),
child: Text(
"\$50",
style: TextStyle(
fontSize: 20,
color: Colors.white
)
),
)
],
)
),
)
],
)
var nextButton = document.getElementById("nextButton");
var textField = document.getElementById("textField");
textField.oninput = function() {
if (textField.value == "") {
nextButton.disabled = true;
} else {
nextButton.disabled = false;
}
}
答案 1 :(得分:0)
您可以在输入标记中使用require属性
<form action="test.php">
<input type="text" required>
<input type="submit">
</form>