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 5011 acoder 16,027
Recognized Expert Moderator MVP
Can you post the client-side generated code instead of the server-side code (view source in the browser).
acoder 16,027
Recognized Expert Moderator MVP
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
Frinavale 9,735
Recognized Expert Moderator Expert
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.
Frinavale 9,735
Recognized Expert Moderator Expert
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 <UpdateParamete rs>.
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 <EditItemTempla te> tags.
Thank you.
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 button, th
calendar is not closing.
here is the select.js file
x999NS4compatible = (document.layers);
var x999IE4compatible = (document.all);
var x999dayabbs = ;
|
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 Calendar Control
to populate the textbox with the date.
I tried the old way but couldn't get the calendar click return to
function...probably not referencing the control correctly.
Is there any way to hide the calendar until the user clicks on...
|
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 my error messages. Currently, it appears that the
detailsview is trying to rebind after the error, to the empty/null detail
item(on insert it is null), and thus I lose all the operator's input. Can
someone suggest the proper way for me to...
|
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. However, I'm not able to set the same
ValidationGroup on the submit controls on the detailsview. Those
linkbuttons(update, insert) are auto generated now.
1. Is it possible to set ValidationGroup on the detailsview?
2. How would I go about...
|
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: 'this.container' is null or not an object
| |
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 the insertbutton, i want a
warning if one or more inputs are not correct and the user must have the
opportunity to correct his errors (so all the fields must remains as it).
I know it exists e.g. "RequiredFieldValidator", but i can't link it to...
|
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 consists of a label control(hidden when run in browser).
Also an Sql data source control connected to database tables for a photo album.
Also label web control ID=UserIdValue.
Also a Details View control ID=dvPictureInsert
Problem is how to work out...
|
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 Photoadmin/default.aspx i got the following message and info.
Input string was not in a correct format.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information...
|
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 would like to get the code for connecting the javascript to asp.net page...
Please help me...
The javascript code is as follows..
|
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
| |
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |