使用Jquery datepicker插入SQL。 [英] Inserting to SQL with Jquery datepicker.

查看:76
本文介绍了使用Jquery datepicker插入SQL。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

下午好。我有一个问题,我认为有一个简单的答案,我只是想不通。



我有一个表格,用户填写其中的数据被插入到SQL数据库中。我在表单中使用的文本框的一个示例是:



Good afternoon all. I have a question that I think has a simple answer and I just can't figure it out.

I have a form that the user fills out in which the data gets inserted into a SQL database. One example of a text box I'm using in the form is this:

<asp:TextBox ID="NameOfAgencyTextBox" runat="server" Text='<%# Bind("NameOfAgency") %>' Width="248px" />





我最近发现了JQuery并发现了一个非常好的日期/时间选择器,我已经在表单中实现了这样的:





I've recently discovered JQuery and found a really nice date/time picker that I've implemented into the form as so:

<script>
  $(function() {
    $( "#datepicker" ).datepicker();
  });
  </script>





ASP Markup



ASP Markup

<input type="text" id="datepicker">





显然选择器有效,但应该插入到现场DateOfIncident。如果我在输入中构造我的绑定应用程序中断即:





Obviously the picker works but it is supposed to be inserted into the field "DateOfIncident". If I construct my binding inside the input the application breaks ie:

<input type="text" id="datepicker" Text='<%# Bind("DateOfIncident") %>





请有人帮帮我吗?另外,如果我需要澄清任何内容,请告诉我。



Please can someone help me? Also, let me know if I need to clarify anything.

推荐答案

(function(){
(function() {


(#datepicker ).datepicker();
});
< / script>
( "#datepicker" ).datepicker(); }); </script>





ASP Markup



ASP Markup

<input type="text" id="datepicker">





显然选择器有效,但应该插入到现场DateOfIncident。如果我在输入中构造我的绑定应用程序中断即:





Obviously the picker works but it is supposed to be inserted into the field "DateOfIncident". If I construct my binding inside the input the application breaks ie:

<input type="text" id="datepicker" Text='<%# Bind("DateOfIncident") %>





请有人帮帮我吗?另外,如果我需要澄清任何内容,请告诉我。



Please can someone help me? Also, let me know if I need to clarify anything.


检查一下: jQuery-UI-DatePicker-Calendar-in-ASPNet [ ^ ]


这篇关于使用Jquery datepicker插入SQL。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆