•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the JavaScript / DHTML / AJAX section within the Web Development category of DaniWeb, a massive community of 401,498 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,214 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our JavaScript / DHTML / AJAX advertiser: Lunarpages Web Hosting
Views: 550 | Replies: 1
![]() |
•
•
•
•
Hi,
Is there any way to end a line of text with three dot if this one is too long for the content box/site layout? Someting like wrap text but without going to the next line.
Thanks for your help
it is very easy to do with javascript as follows:
copy paste the code below into body section of your page for a demo, the process is very simple :
<script>
function SplitText(text,count)
{
if(text.length > count)
{
text = text.substring(0,(count-1));
text = text + "...";
}
return text;
}
</script>
<script>
function demo()
{
newText = SplitText(document.getElementById('Text1').value,10);
alert(newText);
}
</script>
<input id="Button1" type="button" value="button" onclick="demo()" />
<input id="Text1" type="text" />
Serkan Şendur
Last edited by serkansendur : Jan 25th, 2008 at 5:21 am.
![]() |
•
•
•
•
•
•
•
•
DaniWeb JavaScript / DHTML / AJAX Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
ads adsense ajax asp cross-browser javascript menu with few lines of code developer development firefox google home html internet javascript javascript smooth scrolling scroll smoothly window document position javascript tab menu with rounded corners generator link microsoft msdn office prevent javascript menu from getting hidden under flash movies revenue site software sql text unit vista web
- DVD-R Nero illegal disk (Storage)
- Review my graphics site (Website Reviews)
- Q&A VB.NET and Truncated Email - 2 Examples (VB.NET)
Other Threads in the JavaScript / DHTML / AJAX Forum
- Previous Thread: @@Help needed with simple problem@@
- Next Thread: Secure password help!


Linear Mode