Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6904481
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T08:04:00+00:00 2026-05-27T08:04:00+00:00

I have a few functions running on my page. The first one is called

  • 0

I have a few functions running on my page. The first one is called by an onclick event from a select field
this function then calls another function zip()
this function runs a small script.
If the user leaves a field blank then the function should be recalled by the checkit() function as a validation method
it is returning undefined on the second call.. The first call from colorchange() works..

function colorchange(value){
    if (value != ''){
        document.getElementById('delivery').style.borderColor="#000000";
    }
    else{
        document.getElementById('delivery').style.borderColor="#ff0000";
    }
    if (value == 'deliver'){
    zip();
}
}

function checkit(){

    var x=document.forms["pricing_form"]["delivery"].value;
        if (x==null || x=="")
          {
          alert("Please Choose Delivery Method");
          return false;
          }

        if (document.getElementById('delivery').value == 'deliver'){
            alert ('deliver');
            zipcode = document.getElementById('zip') == '';

            if (zipcode == '' || zipcopde == null || zipcode == 'false'){
                alert('please enter a valid zip code');
                zip();
                return false;
            }
        }
}

function zip(){

    var zip = prompt("Ship-To Zip Code", "");

    if (zip != null && zip != ''){
        document.getElementById('zip').value=zip;
        }
        alert (document.getElementById('zip').value);

}

I renamed the fields as follows to get this script to function properly

function colorchange(value){
    if (value != ''){
        document.getElementById('delivery').style.borderColor="#000000";
    }
    else{
        document.getElementById('delivery').style.borderColor="#ff0000";
    }
    if (value == 'deliver'){
    zip_get();
}
}

function checkit(){

    var x=document.forms["pricing_form"]["delivery"].value;
        if (x==null || x=="")
          {
          alert("Please Choose Delivery Method");
          return false;
          }

        if (document.getElementById('delivery').value == 'deliver'){
            alert ('deliver');
            zipcode = document.getElementById('zip') == '';

            if (zipcode == '' || zipcode == null || zipcode == 'false'){
                alert('please enter a valid zip code');
                zip_get();
                return false;
            }
        }
}

function zip_get(){

    var zip_entry = prompt("Ship-To Zip Code", "");

    if (zip_entry != null && zip != ''){
        document.getElementById('zip').value=zip;
        }
        alert (document.getElementById('zip').value);

}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T08:04:01+00:00Added an answer on May 27, 2026 at 8:04 am
    if (zipcode == '' || zipcopde == null || zipcode == 'false'){
    

    You sure it’s the method that’s undefined, or zipcopde?

    I’m also pretty sketched out by naming functions the same as variables–much more dangerous in JavaScript than in some other languages; maybe don’t. Should be okay here, but still.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some python modules containing mostly functions and a few classes. Each one
I have to modify a few tables in one function. They must all succeed,
I have a few very simple jQuery functions running after the document is ready.
I have a few functions that I'm running over a million times on various
I have a few functions which I load in the ready() event. These basically
In one HTML page I have a JavaScript function checkUpdates() that hits the server.
Lets say I have a few utility functions in file tests/utils/functions.js. I would like
I have defined a few different functions in my .bash_profile . I usually remember
I have a fairly simple python loop that calls a few functions, and writes
I have written a few nearly identical functions, except for their names. For example:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.