473,703 Members | 4,024 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 1193

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 anything in VB, so any and all concepts and commands are completely foreign. I have been digging...
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. Unfortunately for me, none of them are usefull at all, so pretty much i don't have a clue as to what i...
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 not equal to blank then update word count but no luck please help me, i'd appreciate any help
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 that puts tick marks at top and bottom. The tick marks do not show up.
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. So i have some questions.
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, ThreeWordMeaning(1000) As String Dim R As Integer, WordsLeft(1000) As Integer Dim SecretWord 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 got that part working - it's pretty easy in C#. What I'm having a hard time with is managing the...
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 usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
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 synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
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 launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
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 into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
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: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.