如何动态获取表单名? <input type="button" name="nsearch" value="查询" onClick="alert(this.form.name);"> 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 document.this.form.name.srepairno.value.tostring()?this.form.name.sprepairno.value.toString()不行:( 这样:function test(){ var formName = event.srcElement.form.name; alert(eval(formName).sprepairno.value);} 或者:document.getElementByName("sprepairno");试试 document.getElementById("ssID")或者document.forms[1].ss.value <form name="form1"><input type="text" name="srepairno" value="oo"><input type="button" name="nsearch" value="查询" onClick="alert(this.form.srepairno.value.toString())"> </form> 灰豆宝宝正解。真晕~,为什么就this.form没试? 自动计算汽车的价格 jquery mouseenter mouseout 多次 【求】可预览+无刷新+带进度条+批量图片上传(JS+PHP) 怎样在jsp中在两个列表框之间通过按钮动态添加和删除列表中元素 简单js问题 帮忙看看。。。 帮我解释一下下边的JavaScript代码: 关于AJAX的问题,相信JAVASCRIPT高手来侃侃~ 请问在HTML文档中如何动态创建一个SELECT对象?详情见内! 咋么样控制编辑框的长度 ▲▲海盗分金币问题▲▲继续求解? 这个下拉式菜单的问题出在哪呀? 如何取字符串中的字符?
this.form.name.sprepairno.value.toString()不行:(
function test(){
var formName = event.srcElement.form.name;
alert(eval(formName).sprepairno.value);
}
或者:
document.getElementByName("sprepairno");
试试
<input type="text" name="srepairno" value="oo">
<input type="button" name="nsearch" value="查询" onClick="alert(this.form.srepairno.value.toString())">
</form>