Actually, I would like to do function with three arguments, which is the field name or form object, the lower limit, and the upper limit. And return true if within range.
Am I doing it right in the beginning?
Please help. THanks
let say if I want to loop through all elements but I don't know the name of the elements that I would like to check, and I use the if .. else statement to write the condition of each element. This is how I did it, but , but it still did not alert when other elements are not filled out.
Anything...
I did the script so that I can pass the arguments in a function. Everything seems fine except when I entered all fields, it will check each field instead of only checking one field at a time. As I have 3 "OnClick" button, how do I make each check button to only check its own field...
Thanks for your help. I did try that and I guess what it did was it loops and check all fields instead of only checking a field when user presses the button.
Any clue will be appreciated. Thanks.
I am trying to make this function:
function check()
{
for (var i=0;i<document.form1.length;i++){
if (document.form1.elements[i].value=="")
{
alert("Please enter your name.");
document.form1.elements[i].focus();
break;
I used to call it...
Hi,
If the function is writtten t his way:
function checkValue(x)
does it means that it only has one argument? How do I make it into three arguments such as the name of the field, lower limit, and upper limit?
Please help. THanks.
Thanks for the fast reply. Here is the whole code :
How do I put these three functions into a function with three arguments?
Thanks again
<html>
<head>
<title>Untitled Document</title>
<script type="text/javascript">
<!--
function alertCheck()
{
a = document.myForm.field1.value...
I actually need three arguments in a function. I need to create one function that will check any field to see if its value is within a range and return a true or false value The function should expect three arguments:
the name of the field (form object)
the lower limit
the upper limit
And I...
I have problems with this code:
If i only called the first form, it will work correctly. But how do I call the second argument and third argument in the same function?
Please advice. THanks.
form name="Form">
Enter a number between 5 and 45: <input type="text"...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.