473,543 Members | 2,003 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Need a little help.

Maybe someone can tell me why I am getting this error.

zip code form test
Event thread: keyup
name: ReferenceError
message: Statement on line 5: Reference to undefined variable: If
Line 5 of inline#2 script in
If(zip.length > 4);
Line 1 of script
zipLook(this.va lue);
At unknown location
[statement source code not available]

<title>zip code form test</title>
<SCRIPT LANGUAGE="JavaS cript" src="../_ScriptLibrary/RS.HTM"></script>
RSEnableRemoteS cripting("../_ScriptLibrary" )
<SCRIPT TYPE="text/javascript">
function zipLook(zip)
If(zip.length>4 )
var objRS = RSGetASPObject( "zip_code.asp") ;
var objResult = objRS.lookZip(z ip);

var strCityState = objResult.retur n_value;

var strLength = strCityState.Le ngth;
var strEx = strCityState.in dexOf('!');
var strCity = strCityState.su bstring(0,strEx-1);
var strST = strCityState.su bstring(strLeng th-2);

document.form1. city.value = strCity;
document.form1. state.value = strST;
document.write( strCity);
document.write( strST);
<form name="form1" method="post">C ity: <input type="text" name="city"
size="30"><br />
State: <input type="text" name="state" size="4"><br />
Zip Code: <input type="text" name="zip" onKeyUp="zipLoo k(this.value)"
size="10"><br />
Phone: <input type="text" name="phone" size="13"><br />

Dec 9 '05 #1
1 1185

Jon Turlington wrote:
message: Statement on line 5: Reference to undefined variable: If This message gave you a hint.
<SCRIPT LANGUAGE="JavaS cript" src="../_ScriptLibrary/RS.HTM"></script>
The language attribute is deprecated, use the type attribute instead:

<script type="text/javascript">
<SCRIPT TYPE="text/javascript">
function zipLook(zip)
If(zip.length>4 )

Your problem lies here, as the hint given to you by the browser. In
javascript, things are case sensitive. It should be a lowercase I, your
'If' should be an 'if' instead.

Dec 9 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

by: Marc | last post by:
Hi all, I am trying to write an application where I need the ability to open an Excel spreadsheet and do basic read/write, insert rows, and hide/unhide rows. Using win32com I have been able to get the basics down as well as some examples displaying how to simply read and write. But the next step appears exponential. I haven never done...
by: Keyed4U | last post by:
I have a drop down list system (works to some extent) for a date range search that I need to do a little more. The following is a small sample from the script: function modify_mo_list(mo_model) { molist = document.forms.querymo2; if (mo_model == '/01/') { var i = 0; molist.options = new Option('February','/02/');
by: OZ | last post by:
Hi, I am new C++ and need a little help with a public domain program that is suppose to perform a byte swap. I am receiving the following error messages during the compile process with Microsoft C++ 2003. Here are the error messages and source code: (97) : error C2664: 'fgetpos' : cannot convert parameter 2 from 'void
by: EkteGjetost | last post by:
This is definitely not the smart thing to do as far as my learning goes, but desperate situations call for desperate measures. The final lab for my introduction to C programming class is due tomorrow. I was on vacation when we went over how to read files, so basically my only resources are the book, the course notes, and the examples....
by: Jintty | last post by:
Hi, I'm trying to write a program that will read a txt file, copy it into another text file and display the number of words, lines and paragraphs. I was able to get the copying portion done, but i'm struggling with the counters. processBlank is supposed to increment the number of words whenever it hits a nonblank, so i figured using if its...
by: Galen Somerville | last post by:
I'm doing something wrong. I made up a test app and put the ZIP file on my website http://home.surewest.net/galen/index.html under Downloads. Basically I have a Panel that will get continuous updates and I don't want any flicker. In the test app it sets up a mem map and sets it to Black. When the Button is clicked it calls a routine...
by: nephish | last post by:
Hello there, i am getting to need to make my web stuff more OO. i have a project at work that we are porting to the internet, and i started learning php to do so. the project is now mamoth is size, and code is reused and pasted all over it. I plan to do a good re-write using better, and cleaner code. So i want to incorporate some classes....
by: U S Contractors Offering Service A Non-profit | last post by:
Brilliant technology helping those most in need Inbox Reply U S Contractors Offering Service A Non-profit show details 10:37 pm (1 hour ago) Brilliant technology helping those most in need Inbox Reply from Craig Somerford <uscos@2barter.net> hide details 10:25 pm (3 minutes ago)
by: raypjr | last post by:
Hi everyone. I need a little help with some parts of a word guessing game I'm working on. I have some parts done but unsure about others and could use a little advice. Any help is very much appreciated.Here is the code to give more detail: Dim GameOver As Boolean Dim NumWords As Integer, ThreeWordList(1000) As String,...
by: bean330 | last post by:
Hey, I'm somewhat new to C# and I need a little help, please! I'm selecting a bunch of records, setting properties on a COM executable and then calling a method on that executable to run. I want to run the executable in separate threads because they can be long-running and it would be optimal for us to run a bunch simultaneously. I've...
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.