[TYPO3-english] coding issue
tom liu
typostudy at gmail.com
Fri Feb 8 15:24:56 CET 2013
Hi,
I have a textarea and select box on my popup page. User can input texts in
textarea, and if user chooses one option from select-box, the value of
select will add to textarea. fx, if user inputs 'I am good.', and then he
chooses option1: I would like to go to this site. The content of textarea
will be 'I am good.I would like to go to this site'
Now I want to put a hyperlink on 'this site', how could I do this? I tried
below code, but does not work.
In popup.php
...
$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
'uid, tstamp, first_name, email, prayer, category, domain',
'tx_prayer',
'uid = '.$prayer.' AND starttime < '.time().' AND endtime > '.time().'
AND deleted = 0'
);
$content = '';
while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
$content = '
<h1>'.$GLOBALS['LANG']->getLL('header_'.$row['category']).$row['first_name'].'</h1>
<p>'.nl2br($row['prayer']).'</p>
<p></p>
<p><b>Send them Encouragement</b> (this will be directly emailed to
them)</p>
<input type="hidden" class="prayer-id" value="'.$row['uid'].'" />
<textarea class="prayer-textarea"></textarea>
<select class="prayer-select" >
<option value="I am good.I would like to go to<a href=\'
http://www.sina.com\'>this site</a>">option1</option>
<option value="b">b</option>
</select>
<p class="prayer-button"><input type="button"
value="'.$GLOBALS['LANG']->getLL('button_send').'" /></p>
';
...
in popup.js
...
$('.prayer-select').change(function() {
$('.prayer-textarea').val($('.prayer-textarea').val()+$('.prayer-select').val());
});
...
More information about the TYPO3-english
mailing list