- Joined
- Jan 21, 2018
- Posts
- 4,762
- Solutions
- 5
- Reaction
- 1,078
- Points
- 1,222
- Age
- 27
hello mga ka phc pa help nito sa code ko.ang problema kasi nito pag space input ko proceed to need step siya ang labas dapat sana value is empty.ano mali dito sa code mga ka phc?ito po code ko .
<!DOCTYPE html>
<html>
<body>
<h1>Textbox Validation</h1>
<input type="text" id="txt1">
<button onclick="val_txt();">Validate Text box</button>
<script>
function val_txt()
{
var txtval = document.getElementById('txt1').value;
if (txtval == "")
{
alert("Value is empty");
return false;
}
else
{
alert("Proceed to next step");
}
}
</script>
</body>
</html>
<!DOCTYPE html>
<html>
<body>
<h1>Textbox Validation</h1>
<input type="text" id="txt1">
<button onclick="val_txt();">Validate Text box</button>
<script>
function val_txt()
{
var txtval = document.getElementById('txt1').value;
if (txtval == "")
{
alert("Value is empty");
return false;
}
else
{
alert("Proceed to next step");
}
}
</script>
</body>
</html>