当用户使用Jquery单击提交按钮时,我想更改文本框的值.我试过了
$('textbox').val('Changed Value');
Run Code Online (Sandbox Code Playgroud)
和
$('#dsf').val('Changed Value');
Run Code Online (Sandbox Code Playgroud)
但这两种方法都没有效
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>serializeArray demo</title>
<style>
body, select {
font-size: 14px;
}
form {
margin: 5px;
}
p {
color: red;
margin: 5px;
}
b {
color: blue;
}
</style>
<script src="//code.jquery.com/jquery-1.10.2.js"></script>
</head>
<body>
<p><b>Results:</b> <span id="results"></span></p>
<form>
<select name="single">
<option>Single</option>
<option>Single2</option>
</select>
<select name="multiple" multiple="multiple">
<option selected="selected">Multiple</option>
<option>Multiple2</option>
<option selected="selected">Multiple3</option>
</select>
<br>
<input type="checkbox" name="check" value="check1" id="ch1">
<label for="ch1">check1</label>
<input type="checkbox" name="check" value="check2" checked="checked" id="ch2">
<label for="ch2">check2</label>
<input …Run Code Online (Sandbox Code Playgroud) 我正在尝试编写一个代码,该代码从用户输入中获取姓氏和名字,并将值存储在带有MVC4的数据表中.我在Accountcontroller.cs下添加了以下代码
这将创建一个提交按钮.一旦用户单击提交按钮,它就会将用户输入添加到数据集中.
private void button_Click( object sender, EventArgs e)
{
SqlConnection cs = new SqlConnection("Data Source = FSCOPEL-PC; ....
SqlDataAdapter da = new SqlDataAdapter();
da.insertCommand = new SqlCommand(" INSERT INTO TABLE VALUES ( Firstname, Lastname, )
}
Run Code Online (Sandbox Code Playgroud)
我还在logincs.html下添加了以下代码,一旦用户登录,它将创建提交按钮.
<button type="submit" id="btnSave" name="Command" value="Save">Save</button>
Run Code Online (Sandbox Code Playgroud)