Javascript and an alias name

J

Jake G

Hi,
I have elements my page with an "alias" in them
e.g.

<input type=hidden id="S_SELLOG" name="S_SELLOG" iegAlias="S_SELLOG01"
maxlength=1 title="Login/Logout" style="top:0; left:0;">

I am trying to refer to them using the alias name

var myObject= event.srcElement;
fieldID = myObject.id;
alias = myObject.alias

It keeps coming up as undefined.

Any suggestions?
 
L

Lee

Jake G said:
Hi,
I have elements my page with an "alias" in them
e.g.

<input type=hidden id="S_SELLOG" name="S_SELLOG" iegAlias="S_SELLOG01"
maxlength=1 title="Login/Logout" style="top:0; left:0;">

I am trying to refer to them using the alias name

var myObject= event.srcElement;
fieldID = myObject.id;
alias = myObject.alias

It keeps coming up as undefined.

If you're testing in Internet Explorer, it's because you haven't
added an attribute named "alias". You added "iegAlias".
If you're testing in Firefox or some other browser, there are
a few other reasons, as well.


--
 
J

Jake G

Jake G said:








If you're testing in Internet Explorer, it's because you haven't
added an attribute named "alias". You added "iegAlias".
If you're testing in Firefox or some other browser, there are
a few other reasons, as well.

--

Sorry that was just a typo.

Here is what i have....

<input type=hidden id="S_SELLOG" name="S_SELLOG" iegAlias="S_SELLOG01"
maxlength=1 title="Login/Logout" style="top:0; left:0;">
var myObject= event.srcElement;

fieldID = myObject.id;
alias = myObject.iegAlias

alert("My Object " + alias)
alert("fieldID " + fieldID)

and alias is still coming up as undefined.
 
L

Lee

Jake G said:
Sorry that was just a typo.

The code you post for people to look at and debug should
always be copied and pasted directly from code that you've
tested in a browser and know behaves the way you describe.


Here is what i have....

<input type=hidden id="S_SELLOG" name="S_SELLOG" iegAlias="S_SELLOG01"
maxlength=1 title="Login/Logout" style="top:0; left:0;">
var myObject= event.srcElement;

fieldID = myObject.id;
alias = myObject.iegAlias

alert("My Object " + alias)
alert("fieldID " + fieldID)

and alias is still coming up as undefined.

And I'm left assuming that you're working in Internet Explorer
because you didn't say otherwise. There's not much that I can
guess about this without knowing what event is causing this
code to be executed.


--
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,160
Messages
2,570,889
Members
47,423
Latest member
henerygril

Latest Threads

Top