Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    New Coder
    Join Date
    Mar 2009
    Posts
    88
    Thanks
    10
    Thanked 0 Times in 0 Posts

    input text and texarea value problem

    Hello all,

    I have a little problem with input field and textarea.

    This is working, notice the value="{$output_url}"
    Code:
    <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}")

    Code:
    <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!

  2. #2
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    15,060
    Thanks
    165
    Thanked 2,250 Times in 2,237 Posts
    <textarea> has no value attribute and you must use the value in between the opeing an closing tags, like
    Code:
    <textarea>Value goes here</textarea>

  3. #3
    New Coder
    Join Date
    Mar 2009
    Posts
    88
    Thanks
    10
    Thanked 0 Times in 0 Posts
    Great, but now it doesn't show the real output, only litterly the words {$output_url} , but not the true value.

    Code:
    <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?

  4. #4
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    15,060
    Thanks
    165
    Thanked 2,250 Times in 2,237 Posts
    Are you echoing it using PHP or using any other templates?

  5. #5
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    15,060
    Thanks
    165
    Thanked 2,250 Times in 2,237 Posts
    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.

  6. #6
    New Coder
    Join Date
    Mar 2009
    Posts
    88
    Thanks
    10
    Thanked 0 Times in 0 Posts
    I'm sorry, I realized to late that there was a question for php.


 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •