Welcome to WebmasterWorld Guest from 54.166.87.123

Forum Moderators: open

Message Too Old, No Replies

Hiding Div Help

Trying to hide a div via ajax

   
12:30 am on Jul 30, 2008 (gmt 0)

5+ Year Member



I am trying to hide a div via ajax using an input button.

here's my function:

function saveHideDetail(divid) {
document.getElementsByName(divid).style.display ='none';
}

here is how i am calling it (php):

onclick=\"saveHideDetail(('next_detail')[0]);\"

When I click in the input button, nothing happens. No errors, nothing. I'm sure it is a syntax issue.

Thanks in advance!

7:35 am on Jul 30, 2008 (gmt 0)

10+ Year Member



Hi,

replace 'getElementsByName' with 'getElementById'

HTH, Tom