473,385 Members | 1,518 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

text area limitation

idsanjeev
241 100+
i want to use fiexd text area with 500 characters is that possible and can use paragraph wise input in text area
Nov 13 '07 #1
7 1810
Expand|Select|Wrap|Line Numbers
  1. var txtarea = document.getElementsByTagName("textarea")[0];
  2. var len = txtarea.length;
  3. if(len>500){
  4.     textarea.value = textarea.value.subString(0,500);
  5. }
  6.  
But I don't know what's the "paragraph wise" mean.
Nov 13 '07 #2
idsanjeev
241 100+
hi where is the problem its not work
Expand|Select|Wrap|Line Numbers
  1. <script language = "javascript">
  2. var txtarea = document.getElementsByTagName("textarea")[0];
  3. var len = txtarea.length;
  4. if(len>500){
  5.     textarea.value = textarea.value.subString(0,500);
  6. }
  7.  
  8. function brvoice()
  9. {
  10.   window.location = "brvoice.asp"
  11. }
  12. function voice()
  13. {
  14.   window.location = "voice.asp"
  15. }
  16. </script>
  17. <td align='left'><textarea name="textarea" cols="50" rows="10"></textarea></td>
  18.  
Nov 19 '07 #3
gits
5,390 Expert Mod 4TB
hi ...

you should put the code in a function and assign a keypress handler to your textarea that calls the function ...

kind regards
Nov 19 '07 #4
idsanjeev
241 100+
hi how can put code in function and assing key handler.
Nov 21 '07 #5
idsanjeev
241 100+
hi i am try to this but no insertion has been done
Expand|Select|Wrap|Line Numbers
  1. <script language = "javascript">
  2.   function counttxt()
  3.   {
  4.      var txtarea = document.getElementsByTagName("textarea")[0];
  5.      var len = txtarea.length;
  6.      if(len>500)
  7.      {
  8.        textarea.value = textarea.value.subString(0,500);
  9.      }
  10.    }
  11. </script>
  12. <td align='left'><textarea name="counttxt" cols="50" rows="10" onKeyPress="counttxt()"></textarea></td>
  13.  
Nov 21 '07 #6
mrhoo
428 256MB
subString is not a method name- javascript is caSe senSitive.
Nov 21 '07 #7
gits
5,390 Expert Mod 4TB
yes :) ... it has to be substring() ...

kind regards
Nov 21 '07 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Andrew Chanter | last post by:
I am writing a little routine to perform the following operations from an Acces 97 mdb: 1. create a fixed width text file 2. create/establish a table type link to the text file in Access 3....
16
by: Roy | last post by:
I use a Access 2K application.I am trying to use Chuck Grimsby(clsReadTextFile.txt)class utility to read a text file and then do a import of the same into my database.The question is how to call...
2
by: Bhupesh Naik | last post by:
This is a query regarding my problem to make a spell and grammar check possible in text area of a web page. We have aspx pages which are used to construct letters. The browser based screens...
10
by: Jake Barnes | last post by:
This weekend I wanted to learn AJAX, so I set up a little toy page where I could experiment. The idea of this page is that you click in one of the boxes to get some controls, at which point you can...
3
by: Ant | last post by:
Hi all, I have been trying to select text in a Text widget programmatically. I have been trying the following minimal example: #================================= from Tkinter import * def...
8
by: Frank Rizzo | last post by:
I am trying to print huge images (much bigger than target paper). I try and use e.PageSettings.HardMarginX and e.PageSettings.HardMarginY in the PrintDocument's PrintPage event to try and...
4
by: Alec MacLean | last post by:
Is anyone aware of a size limit imposed on the subject text when using the System.Net.Mail library? I'm getting problems of message not being recieved if the subject exceeds 15 chars. Thx
1
by: Sura | last post by:
Hi I have a flash interactive window which has html links and this appears on an html page. This window can be moved with the mouse on the html page. The html page has an iFrame too. When the...
1
Haitashi
by: Haitashi | last post by:
Hi guys! First off let me explain that I know it's not possible to output html in a text area and expect it to appear rendered. =) I'm trying to come up with a solution. Basically, I...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.