如何将select的值text用ajax方法写入数据库

如何将select的值text用ajax方法写入数据库,第1张

js的写法是 document.getElemtById("industry").valuejquery接触少 应该是$("#industry").val()

这个值就是你当前选中的option 的值

我明白你的意思,看看这个使用SELECT标签提交到另一个页面获得vlaue值容易!但如何获得select标签值:

select_Indexselected.asp文件

<HTML>

<script language="javascript">//这个函数将SELECT标签值给隐藏表单SELECT_TEXT

function show()

{

form1.select_text.value=form1.test.options[form1.test.selectedIndex].text

form1.submit()

}

</script>

<body>

<form name="form1" action="slect_request.asp">

<select name="test">

<option value="1">one</option>

<option value="2">two</option>

</select>

<input type="hidden" name="select_text">//隐藏表单

<input type=button name="su" value="click me" onClick="javascript:show()">

</form>

</body>

</HTML>

slect_request.asp文件

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<meta http-equiv="Content-Type" content="text/htmlcharset=gb2312" />

<title>无标题文档</title>

</head>

<body>

<%

response.write request("select_text")

%>

</body>

</html>

L语句啊,如果这个目标表TabB不存在可以用下面的语句

select fieldlist into tabB from tabA

这时候会自动创建目标表

如果目标表已经存在,是要往里面追加一些数据的话,可以用

insert into TabB (fieldlist)

select fieldlist from TabA

fieldlist为字段列表


欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/sjk/10024692.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2023-05-04
下一篇2023-05-04

发表评论

登录后才能评论

评论列表(0条)

    保存