Javascript Problem.. Any help?

Results 1 to 4 of 4

Thread: Javascript Problem.. Any help?

  1. #1
    newbye Guest

    Default Javascript Problem.. Any help?

    I have 15 textarea boxes deta, detb, detc,... deto.<BR>I want to limit each one with only 255 chars and if the chars exceed, i am giving and error, after the error i need to focus it back to the same textarea. I can do it one bye one , but is there a way to write just one code that applies to all, I have this code, but I cannot get focus back. I am using this.. How do i get focus back on the textarea<BR><BR>&#060;script language="JavaScript"&#062;&#060;!--<BR>function validate(what) {<BR> if (what.length &#062; 10) {<BR> alert(&#039;Must be less than 10 characters&#039;);<BR> return false;<BR> }<BR> return true;<BR>}<BR>//--&#062;&#060;/script&#062;<BR><BR>Thanx

  2. #2
    Join Date
    Dec 1969

    Default RE: Javascript Problem.. Any help?

    try this:<BR>

  3. #3
    Masac Guest

    Default RE: Javascript Problem.. Any help?

    try do the name of the textbox in a numeric format like name1, name2.... and then use a for loop to generate the code... <BR>

  4. #4
    Harish Guest

    Default RE: Javascript Problem.. Any help?

    try this <BR>document.formname.textareaname.focus()<BR>or<B R>document.formname.textareaname.focus<BR><BR>Hop e this helps<BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts