I'm facing a problem in form related to employee Leave which has two asp controls with calendar image which is built in javascript as,
<asp:textbox id="txtlsdate" runat="server" AutoPostBack="True">
</asp:textbox>
<IMG onclick="javascript:popUpCalendar(this,txtlsdate,' dd-mmm-yyyy');" src="images/calendar/calendar.gif">
<asp:textbox id="txtledate" runat="server" AutoPostBack="True">
</asp:textbox>
<IMG onclick="javascript:popUpCalendar(this,txtledate,' dd-mmm-yyyy');" src="images/calendar/calendar.gif">
Whenever i click on this image and the value of textbox gets changed i want the difference in between the values of date gets calculated and stored in another textbox named "txtTotalLeave"
For this i've written a javascript function as below:
<script language="javascript" src="popcalendar.js" type="text/javascript">
function calc(available,quantity,answer)
{
var var_available = document.getElementById(available);
*var var_quantity = document.getElementById(quantity) ;
*window.alert("hi.........");
*if ( var_available.value == '2' || var_available.value == '7' )
*{*
*
* document.getElementById(answer).value=var_availabl e.value + var_quantity.value;
* window.alert('Error');
***return false;
**}
**return true;
}
</script>
3 4219
I'm facing a problem in form related to employee Leave which has two asp controls with calendar image which is built in javascript as,
<asp:textbox id="txtlsdate" runat="server" AutoPostBack="True">
</asp:textbox>
<IMG onclick="javascript:popUpCalendar(this,txtlsdate,' dd-mmm-yyyy');" src="images/calendar/calendar.gif">
<asp:textbox id="txtledate" runat="server" AutoPostBack="True">
</asp:textbox>
<IMG onclick="javascript:popUpCalendar(this,txtledate,' dd-mmm-yyyy');" src="images/calendar/calendar.gif">
Whenever i click on this image and the value of textbox gets changed i want the difference in between the values of date gets calculated and stored in another textbox named "txtTotalLeave"
For this i've written a javascript function as below:
<script language="javascript" src="popcalendar.js" type="text/javascript">
function calc(txtlsdate,txtledate,txtTotalLeave)
{
var var_1 = document.getElementById(txtlsdate);
var var_2 = document.getElementById(txtledate) ;
document.getElementById(txtTotalLeave).value=var_1 .value + var_2.value;
}
</script>
I'm calling this function from page_load event of my codebehind file.
btnadd.Attributes.Add("onclick", "javascript: checkall('" + txtlsadate.ClientID + "', '" + txtledate.ClientID + "', '" + txttotalleave.ClientID + "');")
This function is not working and i don't know whats wrong with it?
I'm facing a problem in form related to employee Leave which has two asp controls with calendar image which is built in javascript as,
<asp:textbox id="txtlsdate" runat="server" AutoPostBack="True">
</asp:textbox>
<IMG onclick="javascript:popUpCalendar(this,txtlsdate,' dd-mmm-yyyy');" src="images/calendar/calendar.gif">
<asp:textbox id="txtledate" runat="server" AutoPostBack="True">
</asp:textbox>
<IMG onclick="javascript:popUpCalendar(this,txtledate,' dd-mmm-yyyy');" src="images/calendar/calendar.gif">
Whenever i click on this image and the value of textbox gets changed i want the difference in between the values of date gets calculated and stored in another textbox named "txtTotalLeave"
For this i've written a javascript function as below:
<script language="javascript" src="popcalendar.js" type="text/javascript">
function calc(txtlsdate,txtledate,txtTotalLeave)
{
var var_1 = document.getElementById(txtlsdate);
var var_2 = document.getElementById(txtledate) ;
document.getElementById(txtTotalLeave).value=var_1 .value + var_2.value;
}
</script>
I'm calling this function from page_load event of my codebehind file.
btnadd.Attributes.Add("onclick", "javascript: checkall('" + txtlsadate.ClientID + "', '" + txtledate.ClientID + "', '" + txttotalleave.ClientID + "');")
This function is not working and i don't know whats wrong with it?
acoder 16,027
Recognized Expert Moderator MVP
Three threads merged. Do not triple post.
Sign in to post your reply or Sign up for a free account.
Similar topics |
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,...
|
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: 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: 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.
|
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...
| |