PDA

View Full Version : Javascript and ITS - just a tip


cmte_souza
10-25-2002, 04:33 PM
I found this code to be very usefull.

If you are programming with SAP Internet Transaction Server, and want to improve your final HTML with some java scripts, you have to deal with some crazy element names like "~OKCode=SELECT" (that's a button name) or "ZFIITSE0001-USER.name" (that's a field name)

So, in your javascript code, you can't simply reference your element like

document.form.~OKCode=SELECT.focus();

because you'll get an error message.

But you can reference it like

document.form("~OKCode=SELECT").focus();

as some element inside the form (an element collection) object that can be referenced by its index or its name. In this case, by name.

That was very helpfull for me! :thumbsup:

beetle
10-25-2002, 04:36 PM
Yessir! Any element that has a funky name should ALWAYS be referenced with the form's elements collection...I prefer this...

document.forms[0].elements['~OKCode=SELECT'].focus();

cmte_souza
10-25-2002, 04:48 PM
Ok. Even more complete and powerfull!

Actually, I was looking for an online reference for Javascript, where I could find ALL objects, their properties and methods.

I find a lot of tutorials, but sometimes I need a reference.

Like. What's up with the window and document object. Their methods (and parameter types), properties and collections.

beetle
10-25-2002, 05:01 PM
Originally posted by cmte_souza
I find a lot of tutorials, but sometimes I need a reference.

Like. What's up with the window and document object. Their methods (and parameter types), properties and collections. Check the MSDN, Gecko, and xBrowser links in my signature. If you can't find your answer between those three, there IS no answer (hehe) :D