hi,
i need to be able to find out when the user changes a date, which is displayed in a textbox using a CalendarExtende r.
because the CalendarExtende r only allows client side (java) calls and does not call a function in code behind, i have to somehow find a way to do this using java.
i would like to use the OnTextChanged event of the textBox if possible.
i have got most of the code, but i do not know how to retrieve the targetID object of the CalendarExtende r.
i must admit, my java knowledge is not the best and i can not find any info on it.
here the code
<script type="text/javascript">
function UpdateClientDat e(cal)
{
__doPostBack(>> >textBoxObj<<<, 'test');
// textBoxObj is supposed to be the TargetControlID of CalendarExtende r1
// obj of CalendarExtende r1 should be the parameter cal, right ?
}
</script>
...
<asp:TextBox ID="IDE_DATE_FR OM" runat="server" Width="75px" OnTextChanged=" IDE_DATE_FROM_T extChanged"></asp:TextBox>
<ajaxToolkit:Ca lendarExtender ID="CalendarExt ender1" runat="server" Format="dd/MMM/yyyy" OnClientDateSel ectionChanged=" UpdateClientDat e" TargetControlID ="IDE_DATE_FROM " />
...
code behind
protected void IDE_DATE_FROM_T extChanged( object sender, EventArgs e )
{
}
any help would be appreciated
cheers
Martin
2 8184
__doPostback might not be the right way to go if i want to use an event ;)
the follwing function should be more suitable, but i still need to retrieve the obj of the textBox.
function FireEvent(el, ev)
{
var localE = document.create Event("HTMLEven ts");
localE.initEven t(ev.substring( 2, ev.length), true, true);
el.dispatchEven t(localE);
}
since i am using this in a gridView with a dynamic amount of rows, i guess i can
not use the follwing either.
$get('ctl00_Con tentPlaceHolder 2_IDE_DATE_FROM ');
cheers
Martin
hi,
i need to be able to find out when the user changes a date, which is displayed in a textbox using a CalendarExtende r.
because the CalendarExtende r only allows client side (java) calls and does not call a function in code behind, i have to somehow find a way to do this using java.
i would like to use the OnTextChanged event of the textBox if possible.
i have got most of the code, but i do not know how to retrieve the targetID object of the CalendarExtende r.
i must admit, my java knowledge is not the best and i can not find any info on it.
here the code
<script type="text/javascript">
function UpdateClientDat e(cal)
{
__doPostBack(>> >textBoxObj<<<, 'test');
// textBoxObj is supposed to be the TargetControlID of CalendarExtende r1
// obj of CalendarExtende r1 should be the parameter cal, right ?
}
</script>
...
<asp:TextBox ID="IDE_DATE_FR OM" runat="server" Width="75px" OnTextChanged=" IDE_DATE_FROM_T extChanged"></asp:TextBox>
<ajaxToolkit:Ca lendarExtender ID="CalendarExt ender1" runat="server" Format="dd/MMM/yyyy" OnClientDateSel ectionChanged=" UpdateClientDat e" TargetControlID ="IDE_DATE_FROM " />
...
code behind
protected void IDE_DATE_FROM_T extChanged( object sender, EventArgs e )
{
}
any help would be appreciated
cheers
Martin
Martin,
You may call - document.getElementById(<%=IDE_DATE_FROM.Idclient%>)
Regards
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Karthik |
last post by:
I have two textboxes on a web form. The second textbox is
set to readonly. I do a postback after a value is entered
in the first textbox and I set the second textbox
readonly property to false in code-behind. I view the
HTML source before and after the postback. The HTML says
the second textbox is readonly on both instances but
after the...
|
by: Igor Belagorudsky |
last post by:
Hi,
i am trying to analyze data submitted in a form but the problem is that when
i try to create the controls in code (which is what i want to do), it throws
an obect not found exception on postback when i try to Page.FindControl:
private void Page_Load(object sender, System.EventArgs e)
{
if (Page.IsPostBack)
{
|
by: Krista Lemieux |
last post by:
I'm new to ASP.NET and I'm not use to the way things are handled with
this technology. I've been told that when I have a control, I should
only bind the data to it once, and not on each post back (basically
have the data binding done in the If NOT IsPostBack Then statement).
How come? How does this information get preserved?
Which raises...
|
by: bill yeager |
last post by:
I have a simple button and textbox on a webform with a
RequiredFieldValidator tied to the textbox control. The
problem is that a postback never occurs on the webform by
clicking the button even when I have something inside the
textbox.
If I don't have the validator control on the webform, then
the button clicked event gets fired (causing...
|
by: walesboy |
last post by:
greetings -
I have a btnSubmit button with a Handles btnSubmit.click which works great
if all the user does is click that button.
But, if the user ALSO changes a text box on the page (which has it's own
event and autopostback=true) before clicking submit then it fires the text
box event but never fires the btnSubmit event. (I follow it in...
| |
by: Antoine |
last post by:
Hi
I want to avoid postback on a calendar. I have a .NET calendar control in
asp.net.
Ideally I would like to remove any indication of the postback fore/back
months. It sucks.
I would like to control that off another, smaller popup style java cal but
permanetetly in place. Anyone done that?
I already have a sample javascript of choice,...
|
by: antonyliu2002 |
last post by:
I know that this has been asked and answered thousands of times. As a
matter of fact, I know that I need to say
If Not Page.IsPostBack Then
'Do something
End If
for things that needs to be processed by the web server. I am still
struggling to understand this postback logic, and hope that some kind
gurus out there could help me clarify...
|
by: paulcis |
last post by:
I am trying to produce a dynamic form from a database with unknown
amount of records.
I need to read the values and create a new textbox for each.
I need to create the textboxes at page_init stage as indicated by
microsoft.
But I can't seem to save the number of controls in a viewstate
variable or a session variable
when creating them in...
|
by: Peter |
last post by:
ASP.NET
I have an application which use ASP.NET Autocomplete extender which works
great. But I have a question how to update all the fields on the screen
using Ajax.
Users starts typing in a text field which causes the Autocomplete extender
to display 10 like items, after the users selects an item (which is a key in
the database) I want...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
|
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...
| |
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...
|
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...
|
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |