calling java method from html form with out using javascript

Ads
 

calling java method from html form with out using javascript

How can i call java method from a HTML form, java script should be disabled?

View Answers

April 16, 2008 at 7:30 PM

Hi


<html>
<head>
<title>Test Input Validation</title>
<script LANGUAGE="JavaScript">
function testResults(form) {
TestVar = isNumberString(form.inputbox.value)
if (TestVar == 1)
alert ("Congratulations! You entered only numbers");
else
alert ("Boo! You entered a string with non-numbers characters");
}

function isNumberString(InString){
if(InString.length==0)
return (false);
var RefString="1234567890";
for (Count=0; Count < InString.length; Count++) {
TempChar= InString.substring(Count, Count+1);
if (RefString.indexOf (TempChar, 0)==-1)
return (false);
}
return (true);
}
</script>
</head>
<body>
<form name="myform">
<b>Enter a string with numbers only: </b><br/>
<input type="text" name="inputbox" size="30">
<input type="button" name="button" Value="Click" onClick="testResults(this.form)" >
</form>
</body>
</html>


Ads









Related Tutorials/Questions & Answers:
Calling java class method from javascript
Calling java class method from javascript  I want to call a java class method from javascript. The java class method is like "public String[] getWord()". I want to assign this string array value to a variable in javascript. I
Calling In JavaScript Functions from HTML Form To Validate User Entered Data
Calling In JavaScript Functions from HTML Form To Validate User Entered Data  Hello, I have been working for days on my web Form assignment and editing my html to call my functions to validate the user entered data
Advertisements
Html form using JavaScript to display the table content
Html form using JavaScript to display the table content  HI There, Greetings, I am new to this java and I need your assistance. I have created... want to write a Html JavaScript coding to display the content from database
Error in calling javascript function from java
Error in calling javascript function from java  I am callin javascriot function from applet and getting error netscape.javascript.JSException: Unexpected error: This method should not be used unless loaded from plugin.jar
storing date from html form to oracle 10g using servlet
storing date from html form to oracle 10g using servlet  i have following html form from where date,month and year is retrieved separately.. <... this date month year from html form into oracle 10g database where i have
storing date from html form to oracle 10g using servlet
storing date from html form to oracle 10g using servlet  i have following html form from where date,month and year is retrieved separately.. <... this date month year from html form into oracle 10g database where i have
How to export data from html to excel sheet by using java
How to export data from html to excel sheet by using java   How to export data from html to excel sheet by using java
how to load values of html form into an excel table using java servlet?
how to load values of html form into an excel table using java servlet?   i have written a java servlet program, which has a html form to be filled. after filling the form the servlet generates a receipt and the values should
how to update values of a html form into an excel table using java servlets?
how to update values of a html form into an excel table using java servlets?  i have written a java servlet program, which has a html form to be filled. after filling the form the servlet generates a receipt and the values should
How to export data from html file to excel sheet by using java
How to export data from html file to excel sheet by using java   reading the data from Html file
How to export data from html file to excel sheet by using java
How to export data from html file to excel sheet by using java    How to export data from html file to excel sheet by using java
Hi how to transfer table data from html page to excel sheet by using javascript .
Hi how to transfer table data from html page to excel sheet by using javascript .  html page to excel sheet by using javascript and i dont want to transfer all rows in table, i want to hide some rows in excel sheet. Please send
Store image from html img tag into mysql db using java
Store image from html img tag into mysql db using java  Hi. How to get the image displayed in the < img > tag of HTML and store it in the mysql database using java? Thanks in advance
How to get the text from textarea in HTML and store it in database using javascript and jsp
How to get the text from textarea in HTML and store it in database using javascript and jsp  How to get the text from textarea in HTML and store it in database using javascript and jsp <script> function str() { <
Html form validation using jquery
Html form validation using jquery  Hi i am using form with html. Form elements like textbox, radio,checkbox,listbox i was used now how to validate the elements using submit jquery option
HTML form validation using jquery
HTML form validation using jquery  Is there any way for validating html elements common under a class by giving its class name in jquery validation code..that means validating all elements by using its class name if those
Without Using Form in Java Script
Without Using Form in Java Script  HOw to Reset the data in javascript without using form tag
JavaScript deleteTFoot method
then we can delete this table footer by calling the JavaScript method with the table object. Syntax for using deleteTFoot() method is as follows: Syntax... JavaScript deleteTFoot method   
How to change the value of a variable which is set in jsp (by jstl method) by calling the function from js?
) by calling the function from js?  How to change the value of a variable which is set in jsp (by jstl method) by calling the function from js? I set the value in jsp by using jstl method for eg:'<'c:set var="name1" value="Add User
calling a javascript function by passing multiple values from applet in web application
calling a javascript function by passing multiple values from applet in web application  Hi all, I have a requirement like this, I have to call a javascript function from JApplet by passing 3 values. I am new to Applets
JavaScript clearTimeOut method
JavaScript clearTimeOut method       JavaScript's HTML DOM window object method clearTimeOut() method is used to stop or clear the time out variables value
passing textbox value from one page to another page using html n javascript
passing textbox value from one page to another page using html n...; <form type=get action="page2.html"> <table> <tr> <td>...)page2.html: <html> <script LANGUAGE="JavaScript"> function getParams
Hide show HTML forms using javascript
Hide show HTML forms using javascript  How to hide a HTML form in my application using JavaScript?   HTML Code to create checkbox <...;div id="yourDiv"> ...other forms... </div> JavaScript function to hide
Using throw in java method
Using throw in java method  using throw with method implies what
how to print HTML using javascript or Jquery
how to print HTML using javascript or Jquery  is there any way to print a document(created using Html and javascript) without using window.print... single method/code to work for both browser
how to retrieve image from mysql database using java and show it in HTML img tag ?
how to retrieve image from mysql database using java and show it in HTML img tag ?  how to retrieve image from mysql database using java and show it in HTML img tag
Uploading file in servlet from a html form
Uploading file in servlet from a html form  Sir, I want to upload a picture from my html file and save it to my database as BLOB,but what JAR should... this process without using a third party JAR, just using Java API. please help
JavaScript reset() method
: By using Reset button of HTML By using reset() method of JavaScript Example... of code: To illustrate reset() method of JavaScript we have created a simple HTML... JavaScript reset() method      
example of 1700 bir form using html
example of 1700 bir form using html   example of 1700 bir form using html i don't know how to start it... i'm confused on what would i do first and what would i use... :( please help me on this.... thank you in advance
JavaScript blink method
JavaScript blink method     ... this functionality with the JavaScript we can use simple blink() method. We have... a simple html page and in JavaScript we have created a string object which contains
How to design a form using java?
How to design a form using java?  Please help in designing of form using java for my project

Ads