/    Sign up×
Community /Pin to ProfileBookmark

question about select box

There is one textarea and one select box on my popup page, textarea allow user to input texts there, and when user select one option from select box, the value will add to the textarea autommatically, fx. if user input “I like here.” and then he choose (option1): I will go to this site. Then the content in textarea would be I like here. I will go to this site. now I want to put a hyperlink on “this site”. How could I do this? I tried below codes, but it does not work.

In popup.php:

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 will go to <a href=’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());

});

[canned-message]attachments-removed-during-migration[/canned-message]

to post a comment
JavaScript

1 Comments(s)

Copy linkTweet thisAlerts:
@JMRKERFeb 08.2013 — You can add the hyperlink information to the textarea, but clicking on it will accomplish nothing.

You might try copying the .value of the textarea and putting it into a <div> section with .innerHTML = information_to_display;
×

Success!

Help @tomliuwhite spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...