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 3 of 3
  1. #1
    New Coder
    Join Date
    Mar 2010
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Bypass AJAX Button

    I use Zetaboards forum and I wanted a javascript that would use AJAX to hide the fast reply box and put in the form for the full reply box (with smileys, BBCode, etc). Someone posted this:

    Code:
    <script type='text/javascript'>
    if(/\/topic\//.test(location.href)){
    var rplybtn = $('#fast-reply button:contains(Full Reply Screen),.topic-buttons a:has(img[alt=Add Reply])');
    rplybtn.click(function(){
    var url = main_url+'post/?mode=2&type=1&f='+$('input[name=f]:first').attr('value')+'&t='+location.href.split("topic/")[1].split("/")[0], text = $('#fast-reply textarea').val();
    $.get(url, function(q){
    $('#fast-reply').replaceWith($('form[name=posting]',q).clone());
    $('#c_post-text').val(text);
    $('#btn_preview').click(Preview)
    });
    if($(this).is('button')){return false;};
    }).filter('a').attr('href','#copyright');
    };
    </script>
    This code does that via a button. The users have to press a button that says "Full Reply Screen" in order for the script to replace the quick reply box with the full reply box, but I want to remove the button aspect and just have the replacement happen automatically on every page. Any idea what I would need to do to the above code for that to happen?

  • #2
    Senior Coder
    Join Date
    Jan 2011
    Location
    Missouri
    Posts
    3,763
    Thanks
    23
    Thanked 548 Times in 547 Posts
    If your going to do it without giving the user control over it, just write it that way to begin with. Why show 'em something no-one is going to use????

  • #3
    New Coder
    Join Date
    Mar 2010
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I did not write the original code.


  •  

    Posting Permissions

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