Form Validation Forum :: wont work as i want it to, whats wrong?? need help

This thread was displayed: 0 times


Starting with 17th May 2007, Adobe Systems will stop offering support for any version of the discontinued InterAKT products. As a result, we will not answer to new support incidents starting with May 17th, 2007. Pending support incidents will still be followed in order to be closed. The product forums will remain open and be transformed in user-to-user forums. The general forums will be made read-only and not allow new posts or comments.

For more information about the affected products visit: www.interaktonline.com/Support/

View Threaded Show descending
dan san
03-03-2007 11:00:26 GMT +2

hi, I'm a computer science student and I'm having trouble with my code...

this is a code for a static submit page, only needs form validation, i will add the PHP codes for mySql queries later on after i get this right...i need help, don't know whats wrong



<html>
<head>
<META http-equiv=Content-Type c><LINK
href="csslayout.css" type=text/css rel=stylesheet>
<META c name=GENERATOR>
</head>

<body>
<h2><img src="feather.jpg">Submit to Us:</h2>
<script type ='text/javascript'>
function check_entry()
{
var rname = document.getElementById('rname');
    var yname = document.getElementById('yname');
    var country = document.getElementById('country');
    var serving = document.getElementById('serving');
    var procedure = document.getElementById('procedure');
    var ingredients = document.getElementById('ingredients');
  
    // Check each input in the order that it appears in the form!
    if(isAlphabet(rname, "Please name the recipe")){
        if(isAlphabet(yname, "Please enter your name")){
            if(isNumeric(serving, "Please enter exact number of serving.")){
                if(madeSelection(continent, "Please select a Continent")){
                    if(madeSelection(country, "Please Choose a Country")){
                        return true;
                    }
                }
            }
        }
    }
  
  
    return false;
  
}

function isEmpty(elem, helperMsg){
    if(elem.value.length == 0){
        alert(helperMsg);
        elem.focus(); // set the focus to this input
        return true;
    }
    return false;
}
function isAlphabet(elem, helperMsg){
    var alphaExp = /^[a-zA-Z]+$/;
    if(document.submit.rname.value=="")
    {
        alert(helperMsg);
        result=false;
    }
    if(elem.value.match(alphaExp)){
        return true;
    }else{
        alert("Please use only letters");
        elem.focus();
        return false;
    }
  
}


//the problem starts here, because before i added this function, the whole code worked just fine

function madeSelection(elem, helperMsg){
    if(elem.value == "Please Choose"){
        alert(helperMsg);
View full message

Back | Reply | Quote | Top
Razvan Racasanu[InterAKT]Adobe Systems Romania staff
03-05-2007 10:45:03 GMT +2

Hello,

The code is not created with our MX FormValidation extension and since it is custom code, I'm afraid that we cannot help you, as we do not offer commercial support anymore.

However, someone else reading this forum might be able to help you.

Regards,
Razvan RACASANU

Reply | Quote | Top
© Adobe Systems Romania. All rights reserved.