473,385 Members | 1,752 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.

textarea predefined text

4
Hey how are you guys?
Well I have a little question.
How can I add predefined text to this textarea? :S .
Thanks in advanced :D.

Expand|Select|Wrap|Line Numbers
  1. <tr>
  2.         <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
  3.           <tr class="infoBoxContents">
  4.             <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
  5.               <tr>
  6.                 <td><?php echo tep_draw_textarea_field('comments', 'soft', '60', '5', $comments); ?></td>
  7.               </tr>
  8.             </table></td>
  9.           </tr>
  10.         </table></td>
  11.       </tr>
Jun 18 '09 #1
6 3284
Atli
5,058 Expert 4TB
Hi.

Is that function meant to create your textarea?
If so, you would have to edit that function.

You could simply add a parameter for the predefined text, and have it added when the function prints the textarea.
Jun 18 '09 #2
humbis
4
Hrmm, okay I see.
You think the function could be <tr class="infoBoxContents"> by any chance?
And thanks for replying so fast!
Jun 18 '09 #3
Atli
5,058 Expert 4TB
Nope, that would be the top of a table row :)

The function I suspect is creating your textarea is tep_draw_textarea_field.
Do you have that anywhere?

In any case, a simpler, albeit less elegant, way to do this would be to just put the textarea into a PHP variable before echoing it and injecting your text.

Somewhat like:
Expand|Select|Wrap|Line Numbers
  1. <?php
  2. // The text that should be added
  3. $predefinedText = "Hello, this is some text to inject into the textarea.\n\n";
  4.  
  5. $originalArea = tep_draw_textarea_field('comments', 'soft', '60', '5', $comments);
  6. echo preg_replace('/(<textarea[^>]*>)/i', '$1'.$predefinedText, $originalArea);
  7. ?>
Jun 18 '09 #4
humbis
4
Awsome!
I will give this a try right away, thank you very much.
I'll reply with results.
Jun 19 '09 #5
humbis
4
Yay.
Worked very well!!!!
You rock Atli :D.
Thank you very much, I hope to stay in this community, and later on help others.
Jun 19 '09 #6
Atli
5,058 Expert 4TB
I'm glad it worked!
Hope I'll be seeing you around :)
Jun 19 '09 #7

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

Similar topics

4
by: Doug van Vianen | last post by:
Hi, I am working on an Applet which provides some mouse practice for new computer users in our local seniors' computer club. The applet contains several cards, in a card layout, which are...
6
by: Max | last post by:
i want to insert a predefined string in a textarea when i right click on the mouse. i need to do it in internet explorer and mozilla.
4
by: Csaba Gabor | last post by:
What I'd like to do is to be able to set the font of a textarea element to the same font that another element is using (say, for example, an <INPUT type=text ...> element, but if that's a no go,...
5
by: Jesper Rønn-Jensen | last post by:
I have a textarea that must be limited to 70 characters. No big deal -- at least so I thought. * Textarea must not exceed 70 characters * Exceeding content must be cut off * Must work on input by...
11
by: Les Paul | last post by:
I'm trying to design an HTML page that can edit itself. In essence, it's just like a Wiki page, but my own very simple version. It's a page full of plain old HTML content, and then at the bottom,...
14
by: @sh | last post by:
Has anyone a function handy that I can apply to various textboxes within a form, each textbox will permit most characters but I want to ban certain characters from each textbox. Therefore I need...
6
by: Tony | last post by:
The w3schools HTML tag reference for <textarea> http://www.w3schools.com/tags/tag_textarea.asp says that the attributes 'cols' and 'rows' are REQUIRED attributes for the textarea tag. Looking at...
16
by: Jen | last post by:
Hi. I have this problem that I think should be easy but have been struggling with this for days. I have a list based on a recordset from a database. This list consists of records meeting a certain...
3
by: deepthiu | last post by:
I need users to enter some words in textarea in my webpage. Once they submit the form how can i compare the entered words with some predefined text and provide the result using javascript.
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.