|
Just buy a javascript book and start reading and practice the code for it.
SSK.
Anyone who says sunshine brings happiness has never danced in the rain.
|
|
|
|
|
Hi,
Would love to buy a book and practice, but unfortunately there just isn't time for that. This project needs to be done by tomorrow. So, yes, in normal situations I do what you say, but this is not one of those normal situations. At this point the completion is more important than learning, that is why I asked for help or to be pointed at least into a direction. I didn't ask you to write me the code now did I?
Regards,
Elizma
|
|
|
|
|
I have done something like this but I just want to validate for decimal values. Some what like this:
<asp:TemplateField HeaderText="Typing Charges">
<ItemTemplate>
<asp:TextBox ID="txtTypingCharges" runat="server" Width="80px" CssClass="text" Text='<%#Databinder.Eval(Container.Dataitem,"Charges")%>' MaxLength="8" onkeypress="return onlyDigits(this);">
</asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
Javascript function will be:
function onlyDigits(e)
{
var retKey = true;
var IsTwoDecimal = e.value.indexOf(".");
if (window.event.keyCode < 46 || window.event.keyCode > 57 || window.event.keyCode == 47)
{
window.event.keyCode = 0;
retKey = false;
}
else
{
//This code is used to restrict two decimal cost e.g.= 23.55 is valid
//but cost=45.55.66. is not valid.
if (IsTwoDecimal !=-1)
{
var s=e.value.split(".");
if (window.event.keyCode==46 || s[1].length>=2)
{
window.event.keyCode = 0;
retKey = false;
}
}
}
return (retKey);
}
Hope it helps u???
|
|
|
|
|
Hi,
Thanx for your piece of code. It will help me to get at least a starting point. I appreciated your help.
Thanx again.
Regards,
Elizma
|
|
|
|
|
|
i was writing the code on web form closing by calling the function in the body tag.now the situation is , i have to write the code on the master page closing.it does not allow writing the body tag.How should i sort this problem out to display the message on master page closing
Soniagupta1@yahoo.co.in
Yahoo Messenger Id = soniagupta1
|
|
|
|
|
what u want please explain
Piyush Vardhan Singh
|
|
|
|
|
please clearly explain what is your problem?
SSK.
Anyone who says sunshine brings happiness has never danced in the rain.
|
|
|
|
|
I think you and Gagan are working in same company
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
|
|
|
|
|
|
I think your problem is you need to call a javscript funtion on when user close the form/window also i think you need to call this function for a perticual page not for every page this do one thing just put this script in ContetPlaceholder of that page see
<br />
<asp:Content ID="Content2" ContentPlaceHolderID="FormContentPlaceHolder" runat="server"><br />
<script type="text/javascript" src="JS/LandingPage.js" language="javascript"></script><br />
<script type="text/javascript" ><br />
window.onbeforeunload=callThisFunction<br />
<br />
function callThisFunction()<br />
{<br />
alert('hi');<br />
}<br />
<br />
<br />
<br />
</script><br />
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
|
|
|
|
|
window.onbeforeunload=callThisFunction
is out of script tag?
Soniagupta1@yahoo.co.in
Yahoo Messenger Id = soniagupta1
|
|
|
|
|
No it should be in script tag only
see this
<br />
<script type="text/javascript" ><br />
window.onbeforeunload=callThisFunction<br />
<br />
function callThisFunction()<br />
{<br />
alert('hi');<br />
}<br />
<br />
<br />
<br />
</script><br />
Check this <br />
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
|
|
|
|
|
ThanQ......U guys are really great!!!!!!!!!!
Soniagupta1@yahoo.co.in
Yahoo Messenger Id = soniagupta1
|
|
|
|
|
My pleasure
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
|
|
|
|
|
hello Miss soniya Badnam don't .if don't want answer why u post qustion.
Piyush Vardhan Singh
|
|
|
|
|
Hello Friends,
How use javascript function in code behind file aspx.cs
My function Event: onbeforedeactivate();
|
|
|
|
|
Button1.Attributes.Add("OnClick", "javascript:return FunctionName();")
|
|
|
|
|
I want call this function Window close. not for button click.
|
|
|
|
|
|
Current Window Means Open default.aspx. when close the button then call fuction.
|
|
|
|
|
What exactly u want to do, I mean why u want to call javascript function on window close as u can give it in body tag also, somewhat like this:
<body onunload="CloseWindow();">
<script language="javascript" type="text/javascript">
function CloseWindow()
{
alert("1");
}
</script>
|
|
|
|
|
My default.aspx page under content place holder. you know that content place holder under use javascript but can not use html. where the fuction call. so my question ? how function call in code behind file event (closing window).
|
|
|
|
|
The only way to let your code behind know that the window was closed, is an AJAX call.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
My according does not use ajax. if without ajax it is possible please help me urgently
|
|
|
|