Menu

send a quhyperlink in a qudiv?

Anonymous
2007-07-06
2013-04-23
  • Anonymous

    Anonymous - 2007-07-06

    Another question...
    Is there a way to send a quhyperlink in a qudiv?
    My code looks like:
    >
    function test() {
    //here I want to send a quhyperlink in a qudiv, a similar way as send_quinnerhtml do
    }
    qudiv("test");
    >eof

    Thx.

    BrokenClock

     
    • Anonymous

      Anonymous - 2007-07-06

      Sorry, I have to explain myself better. I DO NOT want to send a quhyperlink link send_quinnerhtml sends html, BUT I want to be able to send a quhyperlink inside some html code through send_quinnerhtml...
      So my code looks like:
      >
      function test() {
      $output="HTMLblabla";
      $output=/give_me_a_quhyperlink_code(hyperlinkname,array(params))/;
      $output.="HTMLblabla";
      send_quinnerhtml("test",$output);
      }
      qudiv("test");
      >eof

      I think this should be better.
      Let me know if there is a way to do this.

      Thx a lot,

      BrokenClock

       
    • Christopher Bess

      Sure, its very possible. You can just send regular HTML to the div.

      [CODE]
      function test() { 
      $output="HTMLblabla";
      $output="<a href='URL' name='newHL' id='newHL'>LINK NAME</a>";
      $output.="HTMLblabla";
      send_quinnerhtml("test",$output);

      qudiv("test");
      [/CODE]

      And you can still access 'newHL', example:
      send_qudisplay("newHL", "none");

      Best regards.

       
      • Anonymous

        Anonymous - 2007-07-09

        Hi again,

        Sorry, but I think you did not get the point, even if your answer is really informative. I may explain my self better.
        I do not want to use qutags just to display or hide a hyperlink. I want to insert a real quhyperlink, that, when you click on it, then it generates a call to a PHP function on the server side. I do not want to call an url with the link.
        I have 3 panels. The first is a list of elements. The second is a detail view of one of those elements. The third is a form to add one element to the list. On the first panel, elements are represented by a hyperlink, that, when you click on, update the content of the second panel. This works great. But I do not know how to add one item to the list of the first panel when I complete the third form.

        I hope this make things clearer.

        Best regards,

        BrokenClock

         
    • Christopher Bess

      I understand more now. You can add the qurpc function call.

      [CODE]
      function newHL_click() {
      send_jscode("alert('quhyperlink clicked')");
      }

      function test() { 
      $output="HTMLblabla"; 
      $output="<a href='javascript:void(0)' onclick=\"qurpc('newHL', 'newHL_click')\" name='newHL' id='newHL'>LINK NAME</a>"; 
      $output.="HTMLblabla"; 
      send_quinnerhtml("test",$output); 

      qudiv("test"); 
      [/CODE]

      Best regards.

       
      • Anonymous

        Anonymous - 2007-07-10

        Ok, it works great now, exactly as I wanted. Thanks for that.
        But can I suggest you something? The result code is a little ugly, and not easy to maintain. The send_qu* functions are so nice that I think it should be really better that if you add to quTags some twin functions that instead of directly print the result, return it as the result of the function.
        I mean:
        quhyperlink() directly print the formated hyperlink. Why not write a function just return the result?
        Should be something like:
        [CODE]
        function gimme_quhyperlink() {
          //PHP BLABLA
        }
        function quhyperlink() {
          print gimme_quhyperlink();
        }
        [/CODE]
        If you do so for all quTags, it will give it a powerful loopback feature. And it seems easy to do.

        Let me know what you think.

        Best regards.

         
        • Christopher Bess

          It prints instead of returns the output because I want to enforce the use of qu* functions on the front end and not in the server to client messages.

          Thanks for your feedback and please add it as a suggestion if you really would like to see it implemented.

           
          • Anonymous

            Anonymous - 2007-07-16

            Added to the SF feature request tracker.
            Thx for your work.

             

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.