0

I am using this select one menu on my website to determine the number of results on the page. However, when I change my selection, it does nothing. I was wondering if it was something in my onchange statement that was broken or if there could be another cause?

I have tried changing value to getAttribute('value') and couldn't get that to work either. Also, I can't get my Chrome debugger to set a breakpoint there so I can step through. If anyone can help on any of these fronts that would be most helpful. Thanks.

    <select size="1" id="pageSize" onchange="document.frmDisplay.pageSize.value=this.options[this.selectedIndex].value" style="font-family: verdana, arial, helvetica, sans-serif;font-size: 10px;z-index: 99">
             <option value="10">10</option>
             <option value="20" style="" selected="">20</option>
             <option value="50">50</option>
             <option value="100">100</option>
    </select>
4

1 回答 1

1

Add a name attribute to your select list. The form elements collection indexes members by name (not ID)

<select size="1" name="pageSize" id="pageSize" onchange="document.frmDisplay.pageSize.value=this.options[this.selectedIndex].value" style="font-family: verdana, arial, helvetica, sans-serif;font-size: 10px;z-index: 99">
         <option value="10">10</option>
         <option value="20" style="" selected="">20</option>
         <option value="50">50</option>
         <option value="100">100</option>
</select>

you can still keep the id attribute of course.

actually looking at your code... you are attempting to set the field to its own value... which makes no sense... what are you trying to accomplish?

于 2013-05-31T20:23:13.787 回答