homepage Welcome to WebmasterWorld Guest from 50.19.206.49
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
Forum Library, Charter, Moderator: open

JavaScript and AJAX Forum

    
Hiding Div Help
Trying to hide a div via ajax
lintacious




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

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!

 

Arno_Adams




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

Hi,

replace 'getElementsByName' with 'getElementById'

HTH, Tom

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved