<script>
<!--
function addOption() {
for(var i=0;i<100;i++) {
var sName = "馒头" + i;
var sValue = i;
var oOption = document.createElement('OPTION');
oOption.text = sName;
oOption.value = sValue;
document.form1.select1.options.add(oOption);
}
}function prev() {
document.form1.select1.selectedIndex = document.form1.select1.value - 1;
}function next() {
document.form1.select1.selectedIndex = parseInt(document.form1.select1.value) + 1;
}
//-->
</script><body onload="addOption()">
<form id="form1" name="form1" onsubmit="form_submit(this);">
<select id="select1" name="select1"></select>
<button onclick="prev()">上一页</button>
<button onclick="next()">下一页</button>
</form>
</body>
<!--
function addOption() {
for(var i=0;i<100;i++) {
var sName = "馒头" + i;
var sValue = i;
var oOption = document.createElement('OPTION');
oOption.text = sName;
oOption.value = sValue;
document.form1.select1.options.add(oOption);
}
}function prev() {
document.form1.select1.selectedIndex = document.form1.select1.value - 1;
}function next() {
document.form1.select1.selectedIndex = parseInt(document.form1.select1.value) + 1;
}
//-->
</script><body onload="addOption()">
<form id="form1" name="form1" onsubmit="form_submit(this);">
<select id="select1" name="select1"></select>
<button onclick="prev()">上一页</button>
<button onclick="next()">下一页</button>
</form>
</body>
<!--
function addOption() {
for(var i=000;i<100;i++) {
var sName = "馒头" + i;
var sValue = i;
var oOption = document.createElement('OPTION');
oOption.text = sName;
oOption.value = sValue;
document.form1.select1.options.add(oOption);
}
}function prev() {
document.form1.select1.selectedIndex = document.form1.select1.selectedIndex - 1;
}function next() {
document.form1.select1.selectedIndex = parseInt(document.form1.select1.selectedIndex) + 1;
}
//-->
</script><body onload="addOption()">
<form id="form1" name="form1" onsubmit="form_submit(this);">
<select id="select1" name="select1"></select>
<button onclick="prev()">上一页</button>
<button onclick="next()">下一页</button>
</form>
</body>
indexArray[indexArray.length] = "ab";
indexArray[indexArray.length] = "ab";
indexArray[indexArray.length] = "ac";
indexArray[indexArray.length] = "ad";
:
:
indexArray[indexArray.length] = "za";
indexArray[indexArray.length] = "zb";
indexArray[indexArray.length] = "zc";currP = 0;
currIndex = "aa";goNext()
{
currP ++;
if( currP > indexArray.length) alert('对不起已经是最后一页了. ');
currIndex = indexArray[currP];
for(var i=0;i< listnow.options.length;i++){
if (listnow.options[i].value == currIndex ) {
listnow.options[i].selected=true
break;
}
}
}goPre()
{
currP --; if( currP <0 ) alert('对不起已经是最前一页了. '); currIndex = indexArray[currP];
for(var i=0;i< listnow.options.length;i++){
if (listnow.options[i].value == currIndex ) {
listnow.options[i].selected=true
break;
}
}
}<button onclick="goNext()">下一页</button>
<button onclick="goPre()">前一页</button>我在网吧.不能调试代码.但大概意思就是这样...
if( currP <0 ) alert('对不起已经是最前一页了. ');后加上 return; 退出.