31 users online (0 members and 31 guests)  


  Results 1 to 4 of 4

Related

  1. Replies: 2
  2. Variable in Form action field    Forum: Javascript Forum
    Replies: 4
  3. Form Action help    Forum: HTML Forum
    Replies: 1
  4. delayed action using php + javascript.    Forum: PHP Forum
    Replies: 1
  5. Trigger form action    Forum: HTML Forum
    Replies: 2
  1. #1
    sharkhandler's Avatar
    New User

    Status
    Offline
    Join Date
    Dec 2002
    Location
    Oxford UK
    Posts
    1

    Angry Bizarre action of <TEXTAREA>

    Hi there,

    system:
    IE6
    ASP/VB/SQL Server 6.5



    we are using a <textarea> tag as part of a form, to capture free text input and we've noticed a rather odd behaviour.

    the text area can only accept a maximum of 146 characters. If we use 147, we can't access any information in the form variable from the page the form was submitted to.

    here is the code for the textarea (and trust me it's within bona fide FORT tags:


    <tr>
    <td class="roundtablerowsmall" colspan="2"><TEXTAREA wrap=physical onKeyDown="textCounter(this.form.AdditionalInfo,this.form.remLen,146);" onKeyUp="textCounter(this.form.AdditionalInfo,this.form.remLen,146);" rows="10" cols="60" name="AdditionalInfo"><%=webuser.ReadServerFile("/edynamix/includes/payment/PurchaseRequestTemplate" & webuser.GetGroupEID & ".txt")%></TEXTAREA></td>
    </tr>
    <tr>
    <td class="roundtablerowsmall" colspan="2" align="right"><input type="image" src="/edynamix/images/savesmall.gif" name="save" WIDTH="48" HEIGHT="18"></td>
    </tr>



    the extra script comes from some code I grabbed off the web to provide a character counter as a workaround.

    This is how we acces data from the page we submit the form to:

    AdditionalInfo = Request.Form("AdditionalInfo")


    I mean it's not rocket science, but I swear, I type in 146 characters and I can see data in the 'AdditionalInfo' variable. I type in 147 and boom!

    what gives? <textarea> should hold up to 32K of character information?

    My only guess in service packs for IE6 has done something to the DOM?

    any ideas?

    Paul

  2. #2
    QuietDean's Avatar
    Administrator

    Status
    Offline
    Join Date
    Oct 2000
    Location
    Bournemouth, UK
    Posts
    2,662
    Hi Paul, Welcome to the forums.

    Last version I had to check, the limit for a single element of the request.form array was 102k-ish. So we have plenty of room to maneuver here.

    I suspect the problem is in submission, and the JavaScript.

    At a guess, TExtCounter() looks like this -

    Code:
     function textCounter(field, countfield, maxlimit) {
    if (field.value.length > maxlimit) // if too long...trim it!
    field.value = field.value.substring(0, maxlimit);
    // otherwise, update 'characters left' counter
    else
    countfield.value = maxlimit - field.value.length;
    }
    (if thats correct, hail the power of google)
    And as far as I can see, its meant to also limit the size of a textarea.
    As your form seems to be populated by the contents of a file readin, and the function is called onkeyup or down. Therefore, does the customer have to amend the text in the textbox?

    As a thought, the text-countdown script is not essential, you can limit a form using maxlength. Try the form without the function call, lets at least see if its the javascript thats the problem.
    If one of our members helps you, please click the icon to add to their reputation!
    No support via email or private message - use the forums!
    Before you ask, have you Searched?

  3. #3
    nitewing's Avatar
    Senior Member

    Status
    Offline
    Join Date
    Sep 2002
    Location
    Panama City, Florida
    Posts
    139
    It would appear that you are limiting the characters in this part of the code you gave as an example.

    "><TEXTAREA wrap=physical onKeyDown="textCounter(this.form.AdditionalInfo,this.form.remLen,146);" onKeyUp="textCounter(this.form.AdditionalInfo,this.form.remLen,146);" rows="10" cols="60" name="AdditionalInfo"><%=webuser.ReadServerFile("/edynamix/includes/payment/PurchaseRequestTemplate" & webuser.GetGroupEID & ".txt")%></TEXTAREA>

    Nitewing
    Ann/nitewing

  4. #4
    Doorknob's Avatar
    Super Newbie

    Status
    Offline
    Join Date
    Jun 2002
    Location
    Malaysia
    Posts
    316
    change the integer 146 in :
    (this.form.AdditionalInfo,this.form.remLen,146);"
    to whatever integer u want that's larger.
    you're setting a limit of 146 to the textarea



Tags for this Thread