Thread: Bizarre action of <TEXTAREA>
Results 1 to 4 of 4
Related
-
New: Form data to be copied to action variables Forum: PHP Forum
Replies: 2 -
Variable in Form action field Forum: Javascript Forum
Replies: 4 -
Form Action help Forum: HTML Forum
Replies: 1 -
delayed action using php + javascript. Forum: PHP Forum
Replies: 1 -
Trigger form action Forum: HTML Forum
Replies: 2
-
12-11-2002, 06:24 AM #1
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
-
12-11-2002, 02:36 PM #2
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; }
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 theicon to add to their reputation!
No support via email or private message - use the forums!
Before you ask, have you Searched?
-
12-15-2002, 12:46 PM #3
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>
NitewingAnn/nitewing
-
12-16-2002, 12:35 AM #4
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