Skip to Content
avatar image
Former Member

how to find the htmlb ID of the elements in javascript

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 plain HTML this can be done using the onLoad attribute of the BODY can we do this using HTMLB?

2).Also how can we catch the htmlb elements we created in our forms 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 to catch the htmlb id of any elemnt in javascript?




Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • avatar image
    Former Member
    Sep 29, 2008 at 06:26 PM


    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.



    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      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.