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

  • Home
  • SEARCH
  • 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 4612826
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T01:27:28+00:00 2026-05-22T01:27:28+00:00

I am using this zip code verification script I found online but instead of

  • 0

I am using this zip code verification script I found online but instead of just submitting the form and appending it to the end of the url, I would like for it to execute function shipCalc() when the zip is a valid format. Where would I alter this to call the function?

JS

<script language="javascript">
function validateZIP(field) {
var valid = "0123456789-";
var hyphencount = 0;

if (field.length!=5 && field.length!=10) {
alert("Please enter your 5 digit or 5 digit+4 zip code.");
return false;
}
for (var i=0; i < field.length; i++) {
temp = "" + field.substring(i, i+1);
if (temp == "-") hyphencount++;
if (valid.indexOf(temp) == "-1") {
alert("Invalid characters in your zip code.  Please try again.");
return false;
}
if ((hyphencount > 1) || ((field.length==10) && ""+field.charAt(5)!="-")) {
alert("The hyphen character should be used with a properly formatted 5 digit+four zip code, like '12345-6789'.   Please try again.");
return false;
}
}
return true;
}
</script>

HTML

<form name="form9" onSubmit="return validateZIP(this.zip.value)">
Zip: <input type="text" size="10" name="zip">
<input type="submit" value="Submit">
</form>

FUNCTION I NEED TO CALL IF VALID

<script language="javascript">
function shipCalc() {
$('#cartdialog').load("/ash/shop/shipping.php?zip=" + document.form9.zip.value);
}
</script>
  • 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-22T01:27:29+00:00Added an answer on May 22, 2026 at 1:27 am

    Replace the return true; line with:

    shipCalc();
    return false;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using this script to display all the images in a folder, but I
Using this code to zip a folder and it works perfect on small files
I have found this popular PHP/MySQL Script called Zip Location by SaniSoft and it
I'm attempting to download a zip file using this code: o = urllib2.build_opener( urllib2.HTTPCookieProcessor()
I'm using monorail, activerecord, and jquery. I have a form with a zip code
I'm using this code, to make a request to a given URL: private static
I am using this HTML <html> <head> <Title>EBAY Search</title> </head> <script language=JavaScript src=ajaxlib.js></script> <body>
I am using this code to download multiple file. My problem is that it
I'm using this code for download files from a server via FTP. It works
I'm using the following code to find the newest .zip file in a directory

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.