|
I don know, where i'm wrong....... But this piece of code is not working. Actually wat i am intending to do is, in a multi line textbox( id - txtMessage), whenever the no of characters entered is more than 10 an alert message has to be fired. As of now, i have called the function in my button event. Can any one give me the proper javascript coding which works in content pages.
;
function length()
{
if(document.all('txtMessage').value.length>10)
{
alert('Too many characters')
}
}
With Regards
Raamkumar.T.T
The most difficult phase of life is not when no one understands you ; It is when you don’t understand yourself.
|
|
|
|
|
In which event of the TextBox you are using this JavaScript?
Have you tried with onkeydown event?
|
|
|
|
|
Thanks for the response.. Am using onclientclick event.
The most difficult phase of life is not when no one understands you ; It is when you don’t understand yourself.
|
|
|
|
|
Then the problem is in the script only.
<script type="text/javascript">
function length()
{
if(document.all('txtMessage').value.length>10)
{
alert('Too many characters')
}
}
</script>
The above is your JavaScript. Here document.all('txtMessage') is not a valid method. You have to use document.getElementById('txtMessage')
|
|
|
|
|
I tried tat too. Anyway once again, i'll try tat n let u know. Thanks yaar.
The most difficult phase of life is not when no one understands you ; It is when you don’t understand yourself.
|
|
|
|
|
Did you checked whether the control going into the JavaScript function? Put alerts in appropriate locations and check where it is failing.
|
|
|
|
|
Venkatesh Mookkan wrote: document.getElementById('txtMessage')
I might be wrong, but this is not going to work if "txtMessage" is in content page. ASP.NET prefixes the content placeholder id along with the controls id. So a better approach would be
document.getElementById('<%=txtMessage.ClientId%>')
|
|
|
|
|
While rendering controls in the content pages, ASP.NET will prefix content place holders id with the control id. So when you are accessing using JS, you should specify the full name. Make sure that the control name you used exist in the page. Install firebug, which is an extension for firefox. Firebug can point the error.
|
|
|
|
|
Just try to debug your javascript and check the code first is it calling or not then check each line
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......
i want to give validation on tab key press of particular server control.
just like i have 5 textbox and i wanna give required validation on 1st textbox and in other textbox have another validation.
when press tab on first textbox then only this validation should be fire..
then vice-varsa on every particular control.
Raj
|
|
|
|
|
Hi,
you can use Ajax control for that,
try TextBoxWatermarkExtender...
Search on google for more..
Thanks,
Sun Rays
To get something you must have to try once.
My Articles
|
|
|
|
|
Hi,
I am Asking solution. not search in google, is it possible in asp.net2.0 without using ajax?
|
|
|
|
|
Hi friends.
I want to access property of one page to other page without using Previouse page directory.
Suppose I have one page named a.aspx and other page is b.aspx.
I declare one property in a.aspx and I want to access that property in b.aspx.
can anybody tell me how to do this?
Thanks in advance
please don't forget to vote on the post that helped you.
|
|
|
|
|
Could you tell why you want to implement your logic in this way ?
if you could then i think some one could provide better solution for it
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... "
|
|
|
|
|
playing with bugs ) wrote: Could you tell why you want to implement your logic in this way ?
if you could then i think some one could provide better solution for it
Let me explain.
I am working on Image Editor.You can make banner by usgin text,clipart,image etc...
I have one anchor tag to preview banner image.
I used lightbox javascript for this.
When I click on button,first I want to call ICallBack and set Html String to Static property.After that I set href="viewImage.aspx".
In view image page,I access static proerty and get htmlstring and generate Image from that string to view image.
Now my problem is that when I click on anchor tag,first ViewImage.aspx page is called instead of Icallback.
I need to call first Icallback.
But now I want to set html string in hidden field using javascript on view click and want to access this hidden control on the viewImage.aspx.
You can see here
thanks again
please don't forget to vote on the post that helped you.
|
|
|
|
|
Looks your design is not proper. If you want a common functionality to be used in many pages, create a base class where you define this functionality and inherit all your pages from this base class. Your base class should inherit from System.Web.UI.Page .
|
|
|
|
|
Hello everybody,
I want to design only one master page for different type of users. Menu items should display accoding to permission for a user type. To design, i have used menu tool. I want to connect the menu with different sitemaps, because sitemap stores xml data. I will provide all sitemap with different names menually. When someone logging in it will check the user type and set menu items accordingly.
But sitemap datasource by default connect with web.sitemap and shows menu. There is no option found to menually set other sitemaps for a menu.
How can i link with other sitemap at runtime? And how can i design this type of master page? If there is any other process, please tell me.
Please help me.........
Thank you in advance.
Dipak
|
|
|
|
|
sir plzz any one suggest the csharp coding to take printscreen on an image
|
|
|
|
|
amitbhatt wrote: any one suggest the csharp coding to take printscreen on an image
Print screen of an image ? If you know the image path, why you need print screen ?
|
|
|
|
|
Hi friend
I am opened an asp.net project from networking folder they showing security error in message box
The project is not fully trusted by the .NET runtime.This is Usually because it is either a network share or mapped to a
network share not on the local machine.if the output path is under the project location your code will not execute as
fully trusted and you may receive unexpected security exceptions
who to give permission .Net framework 1.1 Cofig wizard
this project is developing on vs 2003
Prasanna Kumar.B
|
|
|
|
|
You MUST copy the project to your localhost to be able to open it, I think
Mohamed Gouda
Egypt
|
|
|
|
|
how many types of columns we define in a grid view..
|
|
|
|
|
Hi,
you can check this link[^] to get better idea.
Thanks,
Sun Rays
To get something you must have to try once.
My Articles
|
|
|
|
|
Hi i am using vs2003,
Using datagrid hyperlinkcolumn, i am passing parameter from one form o another,
I achieved this one for one parameter,
But i am strugging to pass 2 values,
This is my hyperlink column:
<asp:hyperlinkcolumn target="_self" datanavigateurlfield="fdate" datanavigateurlformatstring="frmTravelExpDetails.aspx?Fdate={0}"
DataTextField="FDatelink" HeaderText="Travel Period">
<itemstyle font-size="14pt" horizontalalign="Center" forecolor="Blue" verticalalign="Middle"></itemstyle>
</asp:hyperlinkcolumn>
i want to pass one more parameter cell in this,
Any one help me,
Thanks & Regards,
Mageshh,
please don't forget to vote on the post
|
|
|
|
|
HMagesh wrote: frmTravelExpDetails.aspx?
Hi,
u can do as per below code.
frmTravelExpDetails.aspx?param1=test¶m2=test2
Like this.
Thanks,
Sun Rays
To get something you must have to try once.
My Articles
|
|
|
|