表單提交代碼
<html>
<head></head>
<body>
<table><tr><td>
<form action="new.html" action=post>
<input name="value" type="text" value="你要輸入的內容">
<input type=submit name=submit>
</form>
</td></tr>
</body></html>
new.html
<html>
<head></head>
<script type="text/javascript" language="javascript">
<!--
function GetQueryString(name)
{
var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)");
var r = window.location.search.substr(1).match(reg);
if (r!=null) return unescape(r[2]); return null;
}
function timer(){
var value =GetQueryString("value");
document.getElementById("value").innerHTML = value;
}
-->
</script>
<body onload="window.setInterval('timer()');">
你輸入的內容是:<div id="value"></div>
</body>
</html>
基本上可以實現你的要求,但遇到中文會出現編碼問題,你到網上再查查!
② html網頁里如何實現表單提交
<%
Response.Buffer=True
datapath = "" '資料庫目錄的相對路徑
datafile ="data.mdb" '資料庫的文件名
connstr="Provider=Microsoft.Jet.OLEDB.4.0;Data Source="&Server.MapPath(""&datapath&""&datafile&"")
On Error Resume Next
Set conn=Server.CreateObject("ADODB.Connection")
conn.open ConnStr
If Err Then
err.Clear
Set Conn = Nothing
Response.Write "資料庫連接出錯,請檢查連接字串。"
Response.End
End If
On Error GoTo 0
%>
新建一個asp文件conn.asp,把這部分內容粘貼到裡面,在需要的葉面中引用。其他部分配合request、restone等
③ 求關於表單提交的網頁代碼
<input name=a value="ok">你漏了type了。
還有,action的目標要是動態頁面,比如asp,htm是不能接受變數的。
以asp為例,beipost.asp
<%
text = request("a")
response.write text
%>
④ html表單內容提交
用form 的action來控制
你可以試試以下代碼
<form action="http://www..com" method="get">
<input name="a" type="text" value="表單提交回" />
<input name="" type="submit" value="提交到別的地方答去" />
</form>
⑤ HTML表單提交到.HTML實例
。。。
你提交過去有啥意義???
html語言沒有編程能力,是一種文本標記語言而已,你指望它能捕獲get然後進行相應處理的話是不可能的。
⑥ jsp表單提交代碼
<form name="form1" action="提交的頁面" method="post">
</form>
<s:radio list="user.sex" list="#{'1':'男','2':'女'}" checked />
添加的話就在Action 文件裡面把值傳進去,然後調用 添加的方法就可以了
⑦ html表單的幾種提交方式總結
最普通最常用最一般的方法就是用submit type.代碼如下:
123
<form name="form" method="post" action="#"> <input type="submit" name="submit" value="提交"> </form>
另外,還有一種常用專的方法是使用圖片:屬
123
<form name="form" method="post" action="# "> <input type="image" name="submit" src="btnSubmit.jpg"> </form>
第三種是使用鏈接來提交表單,用到了javascript的DOM模型:
123
<form name="form" method="post" action="#"> <a href="javascript:form.submit();">提交</a> </form>
⑧ 表單直接提交到資料庫的代碼怎麼寫
你的寫法有問題,表單首先要是一個form,action定義發送的地址,method定義發送的方法,我舉個簡單的例子給你就知道了。
<form action="register.php" method="post">
姓名:<input type="text" name="username" />
密碼:<input type="password" name="passwd" />
<input type="submit" name="register" value="注冊" />
</form>
然後在register.php頁面就可以寫程序了,通過POST方法(method裡面定義的,也可以用get),比如(PHP):
<?PHP
if($_POST[register]) {//如果檢查到有register這個提交動作
$sql ="insert into users (name,password) values ('$_POST[username]','$_POST[passwd]')";//寫好SQL插入語句
$sth = $db -> prepare($sql);
$sth -> execute();//這兩句是PDO資料庫的操作方法,不同的語言不同,就是執行剛才那條SQL語句啦
?>
input裡面的name就是獲取數據的名字,千萬不能搞錯了
⑨ HTML網頁中,也可以作表單,通過提交按鈕,把表單的內容提交到伺服器中,請問提交按鈕的代碼是什麼。
html中表單提交通過form中的action傳遞,在表單最後增加一個submit按鈕就可以提交了