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. - <tr>
-
<td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
-
<tr class="infoBoxContents">
-
<td><table border="0" width="100%" cellspacing="0" cellpadding="2">
-
<tr>
-
<td><?php echo tep_draw_textarea_field('comments', 'soft', '60', '5', $comments); ?></td>
-
</tr>
-
</table></td>
-
</tr>
-
</table></td>
-
</tr>
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.
Hrmm, okay I see.
You think the function could be <tr class="infoBoxContents"> by any chance?
And thanks for replying so fast!
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: -
<?php
-
// The text that should be added
-
$predefinedText = "Hello, this is some text to inject into the textarea.\n\n";
-
-
$originalArea = tep_draw_textarea_field('comments', 'soft', '60', '5', $comments);
-
echo preg_replace('/(<textarea[^>]*>)/i', '$1'.$predefinedText, $originalArea);
-
?>
Awsome!
I will give this a try right away, thank you very much.
I'll reply with results.
Yay.
Worked very well!!!!
You rock Atli :D.
Thank you very much, I hope to stay in this community, and later on help others.
Atli 5,058
Expert 4TB
I'm glad it worked!
Hope I'll be seeing you around :)
Sign in to post your reply or Sign up for a free account.
Similar topics
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...
|
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.
|
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,...
|
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...
|
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,...
|
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...
|
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...
|
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...
|
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.
|
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,...
|
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...
|
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
|
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...
|
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...
|
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,...
|
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...
|
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,...
|
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...
| |