| | |
Resizing text fields
Please support our JavaScript / DHTML / AJAX advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Aug 2006
Posts: 999
Reputation:
Solved Threads: 1
I have two questions, somewhat linked together. I'm trying to create a webform, and for a few pieces of it I'll need to be able to enter descriptions into a field. I've been requested to make the fields in question larger, much like the reply-box field here, so as to make the information within it more easily visible to the people who will have to use the form.
Question 1: Is this reply box some kind of special form input type, and if so what is it called? Is it unique to the mb, or can it be used in ordinary code?
Question 2: If this isn't something special, just an ordinary text input, then how do I resize it for vertical growth? I found the 'size' command for horizontal stretching, but that really doesn't do me much good because it still limits the user to a single visible line of code.
Thanks in advance,
-EnderX
Question 1: Is this reply box some kind of special form input type, and if so what is it called? Is it unique to the mb, or can it be used in ordinary code?
Question 2: If this isn't something special, just an ordinary text input, then how do I resize it for vertical growth? I found the 'size' command for horizontal stretching, but that really doesn't do me much good because it still limits the user to a single visible line of code.
Thanks in advance,
-EnderX
It's a textarea field I think you're referring to, unless I've misunderstood e.g.:
Obviously, you include this within your form tags.
JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
<div style="position:absolute; left:10px; top:10px" CLASS="somediv"><textarea name="msg" style="border:1px; border-style:solid; border-color:#FF0000" rows="4" cols="50"></textarea></div>
Obviously, you include this within your form tags.
Last edited by SnowDog; Oct 17th, 2006 at 11:00 pm. Reason: Correcting typo
•
•
Join Date: Aug 2006
Posts: 999
Reputation:
Solved Threads: 1
Thank you for your kind assistance with this; that appears to be exactly what I want to use.
Next question-what kind of code is needed to prevent it from escaping the single-quote character? Whenever I try to look a the output, if I've included something with a single quote on it (like the word I've, for example) it comes out looking like I\'ve. Any suggestions?
Thanks in advance,
-EnderX
Next question-what kind of code is needed to prevent it from escaping the single-quote character? Whenever I try to look a the output, if I've included something with a single quote on it (like the word I've, for example) it comes out looking like I\'ve. Any suggestions?
Thanks in advance,
-EnderX
You need to use a script to strip out the unwanted codes.
In PHP you could use the preg_replace:
http://uk2.php.net/preg_replace
Or if you wanted to use JavaScript here's an example with cut-and-paste code:
http://javascript.internet.com/forms...haracters.html
In PHP you could use the preg_replace:
http://uk2.php.net/preg_replace
Or if you wanted to use JavaScript here's an example with cut-and-paste code:
http://javascript.internet.com/forms...haracters.html
•
•
Join Date: Aug 2006
Posts: 999
Reputation:
Solved Threads: 1
Maybe I'm just doing this wrong somehow, but it's not working for me. I'm using PHP, and I tried the preg_replace() function you mentioned, but I can't get it to work for the escape characters I'm trying to eliminate. I can get it to eliminate pretty much everything else in the output I've tried checking, but nothing seems to work on the '\' character; attempts to replace it are met with errors. A single one gives something like 'cannot find ]', which is understandable; it's escaping the ']' symbol. Problem is, attempts to double the '\' character up (so as to have the first one escape the second) produce the same error. What am I doing wrong here?
Thanks in advance,
-EnderX
Thanks in advance,
-EnderX
OK. preg_replace isn't the way to go - it appears that there's a bug of some sort from what I could find on the subject. Sorry for misleading you.
This definitely works, though, because this time I tested it before opening my big mouth
You need to make sure you use it just before you display the string because if you pass the cleaned string, say, between pages PHP adds more of those damned backslashes.
It definitely works, though.
This definitely works, though, because this time I tested it before opening my big mouth

JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
# $res is the variable containing the dirty string $mystr = str_replace('\\', '', $res);
You need to make sure you use it just before you display the string because if you pass the cleaned string, say, between pages PHP adds more of those damned backslashes.
It definitely works, though.
Last edited by SnowDog; Oct 19th, 2006 at 1:40 pm.
![]() |
Similar Threads
- Compare two text feilds (JavaScript / DHTML / AJAX)
- can't compate text field? (Java)
- text fields in DW (Graphics and Multimedia)
Other Threads in the JavaScript / DHTML / AJAX Forum
- Previous Thread: a just started i need help
- Next Thread: Print button using rollover images
| Thread Tools | Search this Thread |
acid2 ajax ajaxcode ajaxhelp animate array automatically beta box bug calendar cart checkbox child class codes column cookies createrange() css cursor decimal design disablefirebug dom download dropdown editor element engine enter error events explorer ext file firefox focus form forms frameworks google gwt html htmlform ie8 iframe image() images index internet java javascript jawascriptruntimeerror jquery jsf jsfile jsp jump listbox masterpage math menu microsoft mimic mp4 object onmouseoutdivproblem onmouseover onreadystatechange parent php player post problem progressbar prototype redirect regex runtime scale scroll search select session shopping size sql text textarea toggle validation w3c web website window windowofwords windowsxp wysiwyg \n





