cancel
Showing results for 
Search instead for 
Did you mean: 

how to find the htmlb ID of the elements in javascript

p_k3
Participant
0 Kudos

HI All,

I have to create a JSPDynPage with a simple textview and 2 buttons....

1). I have a javascript function which has to be called once the page is successfully loaded...in plain HTML this can be done using the onLoad attribute of the BODY element...how can we do this using HTMLB?

2).Also how can we catch the htmlb elements we created in our forms in javascript......in plain HTML we can do this using document.getElementById...but when i used the same code in my javascript function it is returning null...i mean it is not able to find the htmlb element with the given id but the the htmlb element is there in my htmlb form...how to catch the htmlb id of any elemnt in javascript?

thanks

--

PK

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hello,

In your JSPDyn page creation you can set and get all the elements properties.

1st Solution:

-- To invoke the htmlb elements use onClick() method.

You can setOnclick() in your java script in jsp page.

On java side call this onclick as

public void ProcessConfirm(Event event) throws PageException {

}

2nd Sol.:

Element id can be set and get through your jspdyn page.

Use setId() on the element to set its id .

I have a document which could be helpful for you which i can email you.

Regards,

Aparna

p_k3
Participant
0 Kudos

i found it in other threads of the forum.

the following code works to find the htmlb elements in javascript

var funcName = htmlb_formid+"_getHtmlbElementId";
var func = window[funcName];
var timeLabel = eval(func("timeDisplay"));

but this code wont work for TextView element, but other elements it works fine.

My problem was that I was trying to catch my TextView element using the control.