<textarea id="Comment" type="text" runat="server" rows="7"
maxlength="2000" />
<input id="SubmitComment" type="button" value="Submit"
onclick="SubmitButton()" />
当用户在文本区域中输入数据并单击“提交”按钮时,我希望将数据传递到submitButton(),然后我可以将其发送到Functions.CommentBoxForInvoiceUpdates
function SubmitButton() {
var commentBoxData = $('#Comment').val();
Functions.CommentBoxForInvoiceUpdates(id, Labour, commentBoxData);
}
Id 和 Labor 是较早定义的,因此它们工作正常,但是当我通过断点运行“CommentBoxData”时,它显示为未定义。 为什么单击“提交”时会发送评论框中的数据?
感谢您的任何想法
最佳答案
您已用 asp.net 标记。确定您正在使用渲染的 ID?
关于javascript - 单击提交按钮时传递文本区域的值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15529363/