Click to See Complete Forum and Search --> : Limiting characters displayed


missmell
11-21-2003, 07:24 PM
Hello All,
I am new to java scripting and need a little guidance. I am in the process of creating a web page that will contain a list of technical articles based on date. My objective is to have only the fist 200 characters display for each technical article listed and a "Read More" link to open a new page and display the full article. I am at the point where I have the page designed displaying the entire article (the information is being pulled from a field in a table) and the read more link. I am stuck at trying to limit the amount of characters displayed for each listed article.

Any ideas on how to go about this?

If I need to provide more detail please advise.

Thank You

Jupac
11-21-2003, 09:30 PM
heres a start

<script type="text/javascript">
function ok(){
if (lol.news.value.length > 200){lol.news.value+="<a href=#>READ oN</a>"; window.focus;}
else
{
lol.news.value = lol.news.value.length;
window.focus;
}
}
</script>
<form name="lol">
<textarea style="width:300px; height:500px; background-color: #000000; color:#FFFFFF;" name="news"></textarea><br>
<input type="button" onclick="ok();" value="check">
</form>

Jupac
11-21-2003, 09:34 PM
o yea the link dosnt work in da teaxt area i was to layz to do it the right way

missmell
11-22-2003, 09:11 AM
I appreciate your reply. I am going to try this out.

Thanks!