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.
Page 2 of 2 FirstFirst 12
Results 16 to 21 of 21
  1. #16
    Senior Coder
    Join Date
    Dec 2010
    Posts
    2,387
    Thanks
    11
    Thanked 565 Times in 558 Posts
    Sorry ... I don't want to assume something wrong ... but I think you still don't give us all the information we need

    Most importantly: Where do you have (or where do you WANT to have) the call to topic.php? Where do the parameters come from?

    As far as I understand: You want to click a link, start a request to topic.php with the two parameters id and quote.

    Where do id and quote come from? What do you want to do with the output of topic.php? Do you want to write the output to the element #replyText or is this element part of topic.php and you only want to read the content of #replyText from topic.php?

    You leave me confused.

  2. #17
    New Coder
    Join Date
    May 2009
    Posts
    17
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by devnull69 View Post
    Sorry ... I don't want to assume something wrong ... but I think you still don't give us all the information we need

    Most importantly: Where do you have (or where do you WANT to have) the call to topic.php? Where do the parameters come from?

    As far as I understand: You want to click a link, start a request to topic.php with the two parameters id and quote.

    Where do id and quote come from? What do you want to do with the output of topic.php? Do you want to write the output to the element #replyText or is this element part of topic.php and you only want to read the content of #replyText from topic.php?

    You leave me confused.
    Sorry for confusing you, let me try to sketch it a little better.

    1) I have topic.php, which is a page that contains user comments.
    2) At each user comment, there is a quote button so users can quote each others comments.
    3) When that quote button is clicked, I want the ColorBox lightbox to open, with the a textarea that has the quoted text inside of it.

    Everything is located on topic.php

  3. #18
    Senior Coder
    Join Date
    Dec 2010
    Posts
    2,387
    Thanks
    11
    Thanked 565 Times in 558 Posts
    And where does $_GET come into play?

    Do you just want to output $_GET["quote"] somewhere on the page into an invisible DIV and make this DIV visible as soon as you click on QUOTE? But this is exactly what you did in your very first post, given that $quote actually contains the quote.

    Sorry I don't get it. Maybe someone else?

  4. #19
    Kor
    Kor is offline
    Red Devil Mod Kor's Avatar
    Join Date
    Apr 2003
    Location
    Bucharest, ROMANIA
    Posts
    8,478
    Thanks
    58
    Thanked 379 Times in 375 Posts
    Quote Originally Posted by slyfox View Post
    Well yes. But a textarea tag do not have a VALUE attr. So:

    Code:
    <textarea><?php echo $quote; ?></textarea>
    No. As I have told you before, but you did not bother to read: TEXTAREA does have a value, and it does not have an innerHTML.
    KOR
    Offshore programming
    -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

  5. #20
    Senior Coder
    Join Date
    Dec 2010
    Posts
    2,387
    Thanks
    11
    Thanked 565 Times in 558 Posts
    Wow ... I did not really know that <textarea> is such a weirdo

    These tests have been performed using FF5

    Test 1
    Code:
    <textarea id="mytext" value="My value text"></textarea>
    This will show an empty(!) textarea

    Test 2
    Code:
    <textarea id="mytext" value="My value text">My innerHTML text</textarea>
    
    var myValue = document.getElementById('mytext').value;
    var myInnerHTML = document.getElementById('mytext').innerHTML;
    This will show a textarea with the text "My innerHTML text". Both variables will have this value, too.

    Bottom line 1: A textarea will only show the text in the innerHTML area initially. The value attribute is being ignored

    Test 3
    Code:
    document.getElementById('mytext').value = "My new value";
    document.getElementById('mytext').innerHTML = "My new innerHTML";
    var myNewValue = document.getElementById('mytext').value;
    var myNewInnerHTML = document.getElementById('mytext').innerHTML;
    This will change the content of the visible textarea to "My new value" (!). But the two variables in the end will have different content. But only the .value is relevant for the textarea.

    Bottom line 2: To programmatically change the content of a textarea you'll have to set the .value property

    Final result: To initially set the content of a textarea via HTML, you need to provide innerHTML. But to change or read the content afterwards, you'll have to use the .value property only. innerHTML will give you the current innerHTML at any given time but it will not always correspond to the visible textarea content!

  6. #21
    Kor
    Kor is offline
    Red Devil Mod Kor's Avatar
    Join Date
    Apr 2003
    Location
    Bucharest, ROMANIA
    Posts
    8,478
    Thanks
    58
    Thanked 379 Times in 375 Posts
    Quote Originally Posted by devnull69 View Post
    To initially set the content of a textarea via HTML, you need to provide innerHTML. But to change or read the content afterwards, you'll have to use the .value property only. innerHTML will give you the current innerHTML at any given time but it will not always correspond to the visible textarea content!
    That is what I was talking about.
    KOR
    Offshore programming
    -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*


 
Page 2 of 2 FirstFirst 12

Posting Permissions

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