0

I need to create a table within the page when the submit button is clicked.. so i use onclick() to call the function javascript.. its working fine for one submit button.. if i had more than one submit button its not working fine..

here is the coding javascript coding.

function openemailbox(formtitle, fadin)
{
    var box1 = document.getElementById('box');

    document.getElementById('filter1').style.display='block';

    var btitle1 = document.getElementById('boxtitle');
    btitle1.innerHTML = formtitle;

    if(fadin) {
        gradient1("box1", 0);
        fadein1("box1");
    }
    else {
        box1.style.display='block';
    }
}

the jsp coding is

<div id="filter1"></div>
<div id="box1">
  <span id="boxtitle"></span>
  ...
</div>

if i give two javascript it is working fine for 1 and not for another..instead it displaying without going into the onclick()

1 Answer 1

1

I don't see a 'boxtitle1' element in your HTML. Is it possible that when you try to set btitle1.innerHTML you're throwing an exception and the rest of your code is getting skipped?

Have you tried walking through the code in firebug or WebKit developer tools to see what happens?

Sign up to request clarification or add additional context in comments.

1 Comment

actually its my mistake..its working for one submit button bt not for another..i have given 2 button and 2 functions for each..

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.