Text box Checking

Ads
 

Text box Checking

I want to Write only the word A-Z in a text box What is the code?

View Answers

April 22, 2011 at 3:01 PM

<html>
<script>
function checkString(text) {
if(isNaN(text)){
return 1;
}
else{
alert("Please enter a valid string. The only characters accepted are A - Z and a - z");

return 0;
}
}
function validate(){
    if(document.form.st.value == ""){
        alert( "Please enter string." );
        document.form.st.focus();
        return false;
    }
    if(checkString(document.form.st.value)==false){
        document.form.st.focus();
        document.form.st.value ="";
        return false
    }
     return true;
   }  
</script>
<form name="form" method="post" onsubmit="return validate();">
Enter Name:   <input type="text" name="st"><br>
<input type="submit" value="Add" name="button">
</form>
</html>

April 22, 2011 at 3:04 PM

<html>
<script>
function checkString(text) {
if(isNaN(text)){
return 1;
}
else{
alert("Please enter a valid string. The only characters accepted are A - Z and a - z");
 document.getElementById("st").focus();
 document.getElementById("st").value ="";
return 0;
}
}
</script>
Enter Name:&nbsp&nbsp&nbsp<input type="text" id="st" onkeyup="checkString(this.value);">
</html>

Ads









Related Tutorials/Questions & Answers:
Text box Checking
Text box Checking  I want to Write only the word A-Z in a text box What is the code
select box and text box validations
select box and text box validations  hi, any one please tell me how to set validations for select box and text boxes using bean classes? thank you   Please visit the following link: http://www.roseindia.net/jsp/user
Advertisements
java script text box
will click submit button the text should be submitted(it shows the value in alert). i also want the text box should generate in front of NEW button(next/prev...java script text box  hi, I created a button when i click
enable text box and label on selection
enable text box and label on selection  hello, Please tell me how to enable label and text box on selection of drop down list box. in drop down list box all values come from database. please reply
Text box control--keypress event
Text box control--keypress event  In my form have a text box...My requirement is... when is type characters in that box... before typing the 3rd character the space should come automatically or programmatically...the sturucture
enable text box
enable text box  Dear all I would like to enable a textbox by clicking on a button. pleas ehelp me out how can i do this regards JV
Drag a Text Box into dynamic positions
Drag a Text Box into dynamic positions  Plz can anyone tell how can i drag a text box using mouse or arrow keys... Im doing a accounts projects and i need this feature for cheque configuration
how to create a text box using awt
how to create a text box using awt  give an example how creat multi buttons & text boxes
How to assign a default value to text box in netbeans
How to assign a default value to text box in netbeans  I have a java application,and i want to assign a default variable to the textbox
J2ME Text Box Example
J2ME Text Box Example       This application illustrates how to create the text box using TextBox class. The TextBox class is a Screen that allows the user to enter and edit text
how to display webservice response in a text box
how to display webservice response in a text box  Hallo, i have created a webservice and when i sended request to my webservice its sending proper response . the point is how to dispaly the response values in a text box usinj
On click Checkbox values displayed in text box
On click Checkbox values displayed in text box  Hi sir, If i onclick the checkbox values should be displayed in text box, the following code is working properly in Internet Explorer browser but its not working in Google chrome
On click Checkbox values displayed in text box
On click Checkbox values displayed in text box  Hi sir, If i onclick the checkbox values should be displayed in text box, the following code is working properly in Internet Explorer browser but its not working in Google chrome
List the names of classes used to create button and text box in Java.
List the names of classes used to create button and text box in Java.  List the names of classes used to create button and text box in Java
populating text box using jsp code
populating text box using jsp code  Sir, How to populate related values in a text box after selecting value from drop down list using JSP and mysql...").selectedIndex; var val = document.getElementById("book").options[cid].text
how can i store text box values as it is in database table
how can i store text box values as it is in database table  CUSTOMER DESCRIPTION
JDialog to create a customized dialog box for entering text data
JDialog to create a customized dialog box for entering text data   ... dialog box for entering text data. The dialog can be split into panes, left pane can contain an image file and the right pane will contain multiple text fields
retrieve value from db in text box + calendar implementation.
retrieve value from db in text box + calendar implementation.  I... there is already a text box..Now i want to get the value retrieved from database in that text field how can i do it... Please help...   Please visit
instead of text boxe i have to show check box as selected.
instead of text boxe i have to show check box as selected.  i have one text field. in that iam getting boolean value either true or false from the database. when ever the valsue is there in textfield, instead of text boxe i
To Retain the values entered in the text box after submit in jsp page
To Retain the values entered in the text box after submit in jsp page   i am working on a jsp pge which has many text boxes and one dynamic drop down. The functionality is when user enters comma separated values in those text
retrieve the data to text fields from database on clicking the value of combo box
retrieve the data to text fields from database on clicking the value of combo box   retrieve the data to text fields from database on clicking the value of combo box . I am not getting it plz help me out .   hi
Insert value of dynamic generated text box in jsp using javascript
Insert value of dynamic generated text box in jsp using javascript  hello sir , i want to generate dynamic text box at run time and i did that using... that dynamically generated text box value into database at a time without
How to Validate dynamically created text box in HTML using Javascript
How to Validate dynamically created text box in HTML using Javascript  Here is the HTML code to create text boxes dynamically. It works properly.... And also how to validate the text boxes created dynamically. <html>
how to display data from mysql table in text box using jsp??
how to display data from mysql table in text box using jsp??  <...="row">Reference GPC</th> 113: <td><input type="text" name...; 115: <th>Numint</th> 116: <td><input type="text
how to prevent no from unroundin off on clicking text box again in JSP and Jquery
how to prevent no from unroundin off on clicking text box again in JSP and Jquery  I am rounding off numbers entered in a text box in jsp but when I reclick that text box ,It shows the same no (unrounded no) again , Though
Just checking elswhere
Just checking elswhere  I have been posting some questions within... question I was looking for is: I have a textarea box which post a single users comment back to the same html page they enter the text. However what I wanted
add text box and select list dynamically and get its value to store it into database using jsp request parameter
add text box and select list dynamically and get its value to store... dynamically added text field but want code to retrive value of dynamically added select box also into next jsp page plz reply me as early as posssible
checking the data
checking the data  Sir, I have built an application where a user types a long string as input. Then after he/she types a single word of that string. I'm supposed to show all strings which have that word in them. Ex. the string
sir plz help in design a jsp page whichis as follow username [_____] select [__>]password [_____] after selection then onlypassword text box is visible
sir plz help in design a jsp page   sir plz help in design a jsp page which is as follow username [ _ ] select [ > ] password [ _ ] after selection then only password text box is visible
Dirty Checking In Hibernate Example
Dirty Checking In Hibernate Example  What is the example of Dirty Checking in Hibernate? Give me some of the example code? Thanks
ModuleNotFoundError: No module named 'checking'
ModuleNotFoundError: No module named 'checking'  Hi, My Python... 'checking' How to remove the ModuleNotFoundError: No module named 'checking... to install padas library. You can install checking python with following

Ads