473,395 Members | 1,647 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Undefined Error--Please Help

function validField() //this is to be sure something is in subject
{
if (document.formDoubleMenuDMA.strSubject.value == "")
{ nameSPAN1.innerHTML = "Please select a subject";
nameSPAN1.style.color='#FF0000';
alert("Please Enter A Subject");
return false; }
else
{ nameSPAN1.innerHTML = "";
return true; }
}
//above refers to below

<select name="strSubject" onblur="validField()" style="width:300">
<span ID="nameSPAN1" style="font-size:8pt;font-face:verdana" ></span>

I get "nameSpan1" is undefined. I was advised to use getelementbyid but
im not sure how to use it...thankyou!

Jul 23 '05 #1
1 1272
SPG
you could use:

var nameSPAN = document.all("nameSPAN1");
nameSPAN.innerHTML = "Please select a subject";
.....

or
var nameSPAN =document.getElementById("nameSPAN1");
nameSPAN.innerHTML = "Please select a subject";

etc..

HTH,

Steve
<rk**@att.net> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...
function validField() //this is to be sure something is in subject
{
if (document.formDoubleMenuDMA.strSubject.value == "")
{ nameSPAN1.innerHTML = "Please select a subject";
nameSPAN1.style.color='#FF0000';
alert("Please Enter A Subject");
return false; }
else
{ nameSPAN1.innerHTML = "";
return true; }
}
//above refers to below

<select name="strSubject" onblur="validField()" style="width:300">
<span ID="nameSPAN1" style="font-size:8pt;font-face:verdana" ></span>

I get "nameSpan1" is undefined. I was advised to use getelementbyid but
im not sure how to use it...thankyou!

Jul 23 '05 #2

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

Similar topics

4
by: Kingdom | last post by:
Having a problem with a jmail email script and cannot seem to solve this error any sugestions welcome. Error shows in browser as Microsoft VBScript runtime error '800a01f4' Variable is...
1
by: Stu | last post by:
I am trying to build the xerces shared library with 2.3.0 version of their source code on an AIX 5.1 32 bit machine with the following version of the g++ compiler /usr/local/bin/g++ -v Reading...
0
by: Nomad | last post by:
I am trying to read an xml file and then add symbols to an SVG Objec depending on what is in the Xxml file. I have downloaded the ActiveXObject from the mcrosoft website and still can't manage...
6
by: mike | last post by:
Hello, After trying to validate this page for a couple of days now I was wondering if someone might be able to help me out. Below is a list of snippets where I am having the errors. 1. Line 334,...
23
by: Jason | last post by:
Hi, I was wondering if any could point me to an example or give me ideas on how to dynamically create a form based on a database table? So, I would have a table designed to tell my application...
4
by: Kurt Schroeder | last post by:
I have a simple aspx page called type with a datagrid/w id=dGrdTyp My code behind page is not reconizing the control on the aspx page. Visualstudio.Net flaggs the dgrdTyp as undefined. Any Help?...
14
by: none | last post by:
i have: #include <math.h> int main (void) { double i = 0.0; double v = 0.0; i = cos(v);
4
by: sublimanized | last post by:
Hello all ... here is my problem. I just got the book "Teach Yourself C ++ in 21 Days" Setup: Fedora Core 6 - i386 GCC 4.1.1 Again, I am a complete newcomer to C++, and this is one of the...
1
by: visiperl | last post by:
Hi All, I'm pretty much at my wits end with vista IIS7 and php. I'm trying to get the gd library function imagecreatefrompng() function operating properly and have been unsuccessful. I've...
0
by: atencorps | last post by:
Hello I have the following code but need some help on it. The idea of the code is the main sections ie Service Management are viewable when the page is loaded and by clicking on the main...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
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,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
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...

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.