Neal ---
You can use the OnLoad event for multiple function calls. Just separate
them with semi-colons ( ; ).
Michael
----- Original Message -----
From: "Neal Lebar" <nlebar@i...>
To: "javascript" <javascript@p...>
Sent: Friday, March 30, 2001 9:23 PM
Subject: [javascript] RE: Calling a function
> The onLoad handler is already being used in the body to preload images.
>
> I tried putting it into an <img> tag but I can't seem to get that to
> work. I'm pretty new to this and I'm not sure what I can and can't do.
>
> I've tried it a few different ways... none seems to work. I'm obviously
> missing something here...
>
> Tried it as a function called from an <img> tag:
>
> //I'm not sure where to put the querystring request... I'm not sure if
> //this is how to do it for this situation. It works for my other pages.
> //But I'm not trying to pass the variable to javascript in the other code.
>
> <% badlogin = Request.QueryString("loginexists") %> (is this right?)
>
> function Reenterlogin(){
>
> if (badlogin=='reenter')
> {
> alert('Login ID already exists');
> }
>
> <IMG border=0 height=1 src="images/shim.gif" onLoad="Reenterlogin()"
> width=1 >
>
>
> I'm probably confusing javascript, vbscript, ado, and asp. They all seem
> to mesh together .... I'm sure time and code will clear this up.
>
> Thanks,
>
> Neal
>
>
>
>
> use the onLoad handler in the BODY tag to check the querystring for a
> > value and then act accordingly.
> >
> > > -----Original Message-----
> > > From: nlebar@i... [mailto:nlebar@i...]
> > > Sent: 30 March 2001 17:57
> > > To: javascript@p...
> > > Subject: [javascript] Calling a function
> > >
> > >
> > > I have a form entry program, where the validation is done
> > > within the entry
> > > program via onClick event and uses the alert box to display the error
> > > message. I then send the user back to the field in question.
> > >
> > > This is a series of programs to add login ID's and I need to
> > > make sure
> > > that 2 logins are not the same. The validation of the login
> > > ID's is in
> > > the update.asp program which is called from the entry
> > > program. If the
> > > logins are the same, I do a response.redirect back to the same entry
> > > program and pass a switch.
> > >
> > > When the entry program is loaded I use a querystring to capture the
> > > switch. At this point I know that there is a duplicate login
> > > (error) and
> > > want to display a simple alert box with the error.
> > >
> > > How do I call a function that brings up a simple alert box?
> > >
> > > Any words of wisdom?
> > >
> > > Thanks,
> > >
> > > Neal
> >