I'm currently creating a web page in ASP.NET and would like to use Jason's Input Calendar as well. I hope someone can help me with a problem that I am facing.
I have a form where I can add new customers. Most of the fields have the following tags within the DetailsView:- - <asp:BoundField DataField="First Name" HeaderText="FirstName"></asp>
As for the Birth Date field, I had converted it to TemplateField. The following is the code:- - <asp:TemplateField ... >
-
<InsertItemTemplate>
-
<asp:TextBox ID="TextBox1" runat="server" Text="" Visible="false"></asp:TextBox>
-
<script type="text/javascript">DateInput("BirthDate",true,"YYYYMMDD")</script>
-
</InsertItemField>
How do i get the value of "BirthDate" into TextBox1? I'm coding in VB.
Thank you
11 4981
Can you post the client-side generated code instead of the server-side code (view source in the browser).
If that's the case, you'd be better off asking in the ASP.NET forum. However, note that once the page loads, server-side code doesn't run (unless using Ajax) and to interact with the page, you'll need to use JavaScript.
I'm currently creating a web page in ASP.NET and would like to use Jason's Input Calendar as well. I hope someone can help me with a problem that I am facing.
I have a form where I can add new customers. Most of the fields have the following tags within the DetailsView. - <asp:BoundField DataField="First Name" HeaderText="FirstName"></asp>
As for the Birth Date field, I had converted it to TemplateField. The following is the code:- - <asp:TemplateField ... >
-
<InsertItemTemplate>
-
<asp:TextBox ID="TextBox1" runat="server" Text="" Visible="false"></asp:TextBox>
-
<script type="text/javascript">DateInput("BirthDate",true,"YYYYMMDD")</script>
-
</InsertItemField>
-
How do i get the value of "BirthDate" into TextBox1? I'm coding in VB.
My original post can be found <snipped: no longer valid, posts have been moved into this thread>.
Thank you
Can you please post the JASON Object that you are using for this calendar.
Specifically could you post the JavaScript/JASON code for the DateInput() function.
-Frinny
Jason's JavaScript Calender can be found here or here.
In classic ASP, if I have the following code:- - <form action="something.asp" method="get">
-
<script type="text/javascript">DateInput("BirthDate",true)</script>
-
<input type="submit" value="Submit" />
-
</form>
all I need to do to get the value is to do as follows:- - bDate = Request.QueryString("BirthDate")
Thanks.
Haha :)
I thought it was JASON (JSON) calendar...not a Calendar created by some guy named Jason :)
This script dynamically created HTML on the page.
It creates <select> elements for the month and the day; it creates a text box for the year; and it creates a hidden field with the current selected date.
The problem is that it's dynamically created HTML which means you cannot access it in your Server Side VB code like you would a DropDownList, or TextBox or ASP HiddenField.
You might be able to access the hidden field using the Request.Params('hiddenFieldID')....
Give that a try.
If it doesn't work we can look at changing your solution to use ASP controls (like the Ajax Toolkit's Calendar control) instead of HTML elements that are not easily accessible in your VB code.
I found a solution to this problem.
In the
tags, remove - <asp:TextBox ID="TextBox1" ...</asp>
and replace with the script - <script type="text/javascript">DateInput("CandidateBirthDate",true,"YYYY-MM-DD")</script>
Within the - <asp:OBjectDataSource ...>
tags, look for
tags and replace - <asp:Parameter Name="CandidateBirthDate" Type="String" />
with - <asp:FormParameter FormField="CandidateBirthDate" Name="CandidateBirthDate" Type="String" />
I suppose it should also work with the <UpdateParameters>.
Ok, I've got another one. - <script type="text/javascript>DateInput("BirthDate",true,"YYYY-MM-DD",DisplayDate)</script>
DisplayDate is the date to be displayed in browser.
Question:
1) How do I create variable DisplayDate?
2) How do I add value from a database to DisplayDate?
The script is still in DetailsView, in the <EditItemTemplate> tags.
Thank you.
@Frinavale
I'd just point out that the data interchange format is called JSON (though you would probably read it as "Jason").
Hehe it sounds all the same in my head :)
I'm not very familiar with JSON. I've only read about it and haven't actually had the chance to use it yet. I keep my eyes open for an opportunity though :)
Sign in to post your reply or Sign up for a free account.
Similar topics
by: vinu |
last post by:
I have a javascript file named select.js. This is a file which is use
to pop up a calendar, when clicked on a calendar icon in an ASP file.
have a close button in the calendar. When i click on the...
|
by: K B |
last post by:
I finally figured out how to use the Calendar Control in DetailsView
edit, HOWEVER, it's awkward having the control show. My users are used
to having an image to click on then bring up a pop-up...
|
by: jparlato |
last post by:
I'm using the detailsview to perform edit and insert of new records via an
object datasource.
If an error occurs on the insert, I want to preserve the data the operator
tried to input, along with...
|
by: Kjell Arne |
last post by:
Hi!
I have a detailsview control in a webpart with some templated fields on. I
set the ValidationGroup property to som value on these fields to distinguish
from other web parts on the page....
|
by: GV |
last post by:
Hi all,
New to developing in VS 2005 ASP 2.0
Trying to have a easy pop calender for a button on a web page.
I keep getting a error message in IE6 that says:
Line 69
Char 3
Error:...
|
by: Cas |
last post by:
Hi,
I use a detailsview control for inputtng data. I want to check the user
input before it is sent to the database (min. /max value, not empty, only
some values allowed ...). When clicking on...
|
by: sehguh |
last post by:
Hiya Folks,
I am Currently using windows xp. Also using Visual Web Developer 2005 and Microsoft Sql server 2005.
The main page consists of an aspx page and a master page.
The page also...
|
by: sehguh |
last post by:
Hello folks
I have recently been studying a book called "sams teach yourself asp.net 2.0 in24 hours by scott mitchell. I have reached page 614 but when i tried to run an asp page called...
|
by: mathewgk80 |
last post by:
HI all,
I am having popup calendar Javascript code. But i dont know how it is connecting to asp.net code.. I am using asp.net,c#.net and also using 3tier architecture with master page....
I...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
| |