PDA

View Full Version : input text and texarea value problem



boemboem
Jun 14th, 2009, 04:26 PM
Hello all,

I have a little problem with input field and textarea.

This is working, notice the value="{$output_url}"

<input name="newurl" type="text" value="{$output_url}" onkeyup=limiter() {literal}onfocus="if (typeof(document.layers) == 'undefined' || typeof(textarea_selected) == 'undefined') {textarea_selected = 1; document.newurlform.elements['newurl'].select();}" {="{" literal}="literal}" />

When I try to accomplish the same with a texarea, the area doesn't show the output of the URl (value="{$output_url}")


<textarea name="newurl" value="{$output_url}" onkeyup=limiter() {literal}onfocus="if (typeof(document.layers) == 'undefined' || typeof(textarea_selected) == 'undefined') {textarea_selected = 1; document.newurlform.elements['newurl'].select();}" {="{" literal}="literal}" /></textarea>

It doesn't show anything in the textarea.

Any help would be great!

abduraooft
Jun 14th, 2009, 04:54 PM
<textarea> has no value attribute and you must use the value in between the opeing an closing tags, like

<textarea>Value goes here</textarea>

boemboem
Jun 14th, 2009, 05:11 PM
Great, but now it doesn't show the real output, only litterly the words {$output_url} , but not the true value.


<textarea name="newurl" cols="50" rows="4" wrap="physical" onkeyup="limiter()" {literal}onfocus="if (typeof(document.layers) == 'undefined' || typeof(textarea_selected) == 'undefined') {textarea_selected = 1; document.newurlform.elements['newurl'].select();}" {="{" literal}="literal}">{$output_url}</textarea>

Can you tell me why?

abduraooft
Jun 14th, 2009, 05:30 PM
Are you echoing it using PHP or using any other templates?

abduraooft
Jun 14th, 2009, 05:45 PM
btw, please follow http://www.codingforums.com/rules.htm
# 1.2) Do not crosspost- CodingForums.com is divided into various categories. When initiating a thread, always locate the most appropriate category, and post your question only ONCE, in that category. Do not post the same question in multiple categories.

boemboem
Jun 14th, 2009, 05:57 PM
I'm sorry, I realized to late that there was a question for php. :)