开发者

javascript validation for a string given in the textbox of a form [closed]

开发者 https://www.devze.com 2023-02-25 01:05 出处:网络
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical andcannot be reasonably answered in its current form. For help clari
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 9 years ago.

i have created a form having an input textbox with button.

Once I enter the string "run" in the input text box of form (specifically) it should show the page containing three boxes.the thing is am not able to implement the javascript for validating or checking that particular "run" string.

but am getting the box containing pages.

please give me suggestions r help me开发者_如何学Python to solve this problem.


I think this you wanted to compare the string "run" and if it matches then redirect to the page which contains 3 boxes !!

<html>
<head>
<script type="text/javascript">
function validatetxtbox()

{
    var txtfield;
    txtfield =document.getElementById('txtbox').value;

    if(txtfield == "run")
    {
alert("you entered string right");
window.onload="url u want to redirect after checking entered string is right"          
}
else
{
alert("Try again");
}
    }
    </script>
</head>

<body>
<input type="text" id="txtbox" maxlength="3">
<input type="button" id="btn" value="Send" onclick="validatetxtbox()">
</body>

0

精彩评论

暂无评论...
验证码 换一张
取 消