Discussions

Web tier: servlets, JSP, Web frameworks: Javascript Error

  1. Javascript Error (2 messages)

    Hi,

    I am displaying two columns of checkboxes based on the condition, by iterating thru <logic:iterate>. I can clik any checbox from both columns and if i submit, it works fine. But for some condition, second check box column wont be created. And i can select checkboxes from only one column. But now the problem is, as i am calling javascript function while submitting the form, bcoz of non-existence of second column element, it is failing.


    function select() {
      var lockArr = new Array(document.selectForm.lock.length);
      var unlockArr = new Array
                   (document.selectForm.unlock.length);
    ........
    ...

    this is the snap of my code which i call thru onSubmit="javascript:select().....

    'lock' and 'unlock' are checkbox name which will be created in <logic:iterate>. For some condition, any one of these two checkboxes wont be created. But i am referring both inside the function. That is problem. Dont know how to solve it?

    Need help on this. Thanks & appreciations in advance.

    Kannan

    Threaded Messages (2)

  2. Javascript Error[ Go to top ]

    Put the code that access the unlock (the checkbox's which are not created ) in
    if(document.selectForm.unlock)
    {
    ..
    ..
    }
    .
  3. Javascript Error[ Go to top ]

    Done. Thanksalot Girish.