homepage Welcome to WebmasterWorld Guest from 54.211.95.201
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
Forum Library, Charter, Moderator: open

JavaScript and AJAX Forum

    
select onchange not working on IE7
crbotto




msg:3750808
 9:51 pm on Sep 23, 2008 (gmt 0)

Hi, this is my first posting here.
I have a question that appears to be very simple but it's driving me crazy.
The following code doesn't work on IE 7.0, it never calls showDocument:

function showDocument(){
alert("showDocument");
}

<table class="items">
<tr class="item">
<td class="label">Document:</td>
<td class="data">
<select name="file" onchange="showDocument()" id="file" size="1">
#foreach ($f in $files)
<option value="$f" #if ($rec.docID == $f.id) SELECTED #end> $!f.linkname</option>
#end
</select>
</td>
</tr>
</table>

Any help will be very welcome
Thanks

 

MichaelBluejay




msg:3751011
 8:03 am on Sep 24, 2008 (gmt 0)

Hello, and welcome to WebmasterWorld!

When you post problems here, please post only the relevant portions of your code. That is, please make your code as simple as possible, containing only the elements necessary to reproduce the problem. When I do that this code works fine for me:

<script type=text/javascript> 
function showDocument(){
alert("showDocument");
}
</script>

<select name="file" onchange="showDocument()">
<option>1</option>
<option>2</option>
</select>

[edited by: MichaelBluejay at 8:04 am (utc) on Sep. 24, 2008]

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