c# check if textbox is not empty
if (String.IsNullOrEmpty(textBox1.Text))
{
// Do something...
}
c# check if textbox is not empty
if (String.IsNullOrEmpty(textBox1.Text))
{
// Do something...
}
javascript check if input is empty
<!-- check if any input field in "Form" is empty using JS -->
<script type="text/javascript">
function validateForm() {
var a = document.forms["Form"]["answer_a"].value;
var b = document.forms["Form"]["answer_b"].value;
if (!a || !b) {
alert("Please Fill All Required Fields");
return false;
}
}
</script>
<form method="post" name="Form" onsubmit="return validateForm()" action="">
<input type="text" name="answer_a" value="">
<input type="password" name="answer_b" value="password">
</form>
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us