急救,立即给分,怎么将
  • 中的option的value删掉
  • mastererp 2003-05-05 12:03:32
    我用这个删掉:(addedcar是select的name)
    theform.addedcar.options.remove(theform.addedcar.selectedIndex);

    发现虽然网页中看到的<select>中,已经没有了被删掉的值,但是提交后,被删掉的值实际还存在:
    for(i=0;i<theform.addedcar.options.length;i++)
    {
    theform.sCarNos.value = theform.sCarNos.value + theform.addedcar.options[i].text + ';'
    }

    我应该怎么得到实际剩余的值??
    ...全文
    43 2 打赏 收藏 转发到动态 举报
    写回复
    用AI写文章
    2 条回复
    切换为时间正序
    请发表友善的回复…
    发表回复
    mastererp 2003-05-05
    • 打赏
    • 举报
    回复
    还是有
    我用alert (theform.addedcar.options.value);看不到任何值
    用alert (theform.sCarNos.value); (sCarNos是一个字串,得到所有的select中的项)看到的就包括已经删除的项

    这样用对不对??
    youbest 2003-05-05
    • 打赏
    • 举报
    回复
    改成
    theform.addedcar.remove(theform.addedcar.selectedIndex);
    试试

    87,988

    社区成员

    发帖
    与我相关
    我的任务
    社区描述
    Web 开发 JavaScript
    社区管理员
    • JavaScript
    • 无·法
    加入社区
    • 近7日
    • 近30日
    • 至今
    社区公告
    暂无公告

    试试用AI创作助手写篇文章吧