The forum of the forums

Would you like to react to this message? Create an account in a few clicks or log in to continue.
The forum of the forums
4 posters

    Private Message Form Redirects to Specific Page

    DesignersSociety
    DesignersSociety
    Forumember


    Female Posts : 146
    Reputation : 3
    Language : english

    In progress Private Message Form Redirects to Specific Page

    Post by DesignersSociety Thu 9 Oct - 23:41

    So I'm using the private message form for other parts of my site so that messages are sent to me from the members. I created a success page that I want it to redirect to instead of the private message sent page, but it doesn't seem to work. I tired this which does redirect it but the message is never sent to me, so it basically messes up the form or something? Note, I may want to use this with different redirects based on what I'm using the form for so if there's a way to do this for the specific form instead of just all private messages that would be helpful. Especially since I'd still like when members send a private message they get the private message sent page, or are sent to the inbox or something. 

    Code:
     <form id="privatemessage" action="/h58-boutique-entry-sent" method="post" name="post" class="textarea">
    <input name="username[]" type="text" style="display:none" value="Leandra"/>
    <input  name="subject" type="text" class="usernameinput" value="boutique of the month" style="display:none"/>
      <input type="text" id="cartMessage" class="noThis" name="message" >
    <input type="submit" class="sendingBut" name="post" value="Submit" />
    </form>

    Also this was the original part of the form which works but shows the private message sent page:
     action="/privmsg"
    SLGray
    SLGray
    Administrator
    Administrator


    Male Posts : 51498
    Reputation : 3523
    Language : English
    Location : United States

    In progress Re: Private Message Form Redirects to Specific Page

    Post by SLGray Fri 10 Oct - 0:17

    I still do not understand what exactly you want.  Could you explain it step by step?



    Private Message Form Redirects to Specific Page Slgray10

    When your topic has been solved, ensure you mark the topic solved.
    Never post your email in public.
    _Twisted_Mods_
    _Twisted_Mods_
    Helper
    Helper


    Male Posts : 2083
    Reputation : 336
    Language : English
    Location : Ms

    In progress Re: Private Message Form Redirects to Specific Page

    Post by _Twisted_Mods_ Fri 10 Oct - 0:28

    this is for post i think but it could help you figure out your code

    https://help.forumotion.com/t134669p30-reply-to-topic-redirect?highlight=post+redirect
    DesignersSociety
    DesignersSociety
    Forumember


    Female Posts : 146
    Reputation : 3
    Language : english

    In progress Re: Private Message Form Redirects to Specific Page

    Post by DesignersSociety Fri 10 Oct - 1:22

    @SLGrey I basically want to make this specific form redirect to a specific page that i choose instead of the private message sent page.
    DesignersSociety
    DesignersSociety
    Forumember


    Female Posts : 146
    Reputation : 3
    Language : english

    In progress Re: Private Message Form Redirects to Specific Page

    Post by DesignersSociety Sun 12 Oct - 18:31

    Bump
    Ange Tuteur
    Ange Tuteur
    Forumaster


    Male Posts : 13207
    Reputation : 3000
    Language : English & 日本語
    Location : Pennsylvania

    In progress Re: Private Message Form Redirects to Specific Page

    Post by Ange Tuteur Sun 12 Oct - 23:22

    Hello DesignersSociety,

    Try this :
    Administration Panel > Modules > HTML Pages management

    Add this to an HTML page :
    Code:
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js" type="text/javascript"></script>
    <form id="privatemessage" action="/privmsg" method="post" name="post" class="textarea" onsubmit="sendData();">
     Â <input name="username[]" type="text" style="display:none" value="Leandra"/>
     Â <input  name="subject" type="text" class="usernameinput" value="boutique of the month" style="display:none"/>
     Â <input type="text" id="cartMessage" class="noThis" name="message" />
     Â <input type="submit" class="sendingBut" name="post" value="Submit" />
     Â <span id="authData"></span>
     Â <script type="text/javascript">jQuery('#authData').load('/privmsg?mode=post input[name="auth[]"]')</script>
    </form>
    <script type="text/javascript">function sendData() { localStorage.postPM = true }</script>

    If you chose "Use your forum header and footer", remove this portion from the code above :
    Code:
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js" type="text/javascript"></script>


    Next go to JavaScripts code management and create a new script :

    Title : Your choice
    Placement : In all the pages
    Paste the code below and save :
    Code:
    if (localStorage.postPM) {
     Â location.pathname = '/h58-';
     Â localStorage.removeItem('postPM');
    }

    After sending a PM with the form I provided, you should be redirected to html page 58. Take note that this method wont work on outdated browsers.
    DesignersSociety
    DesignersSociety
    Forumember


    Female Posts : 146
    Reputation : 3
    Language : english

    In progress Re: Private Message Form Redirects to Specific Page

    Post by DesignersSociety Mon 13 Oct - 3:27

    Thank you so so much that worked! Also any chance you know how to make profile fields work in an iframe? When I try to put this on an html page and then use an iframe for that page on another page, it won't show? I know its more than I originally asked but that'd really help.      
    This is on say html page 50: 

    Code:
    Your Profile:<span id="profileedit" align="center"></span></center>

                             
    <script>$('#profileedit').load('/profile?mode=editprofile .three-col')
                                          </script>  


    And then this on html page 51: 

    Code:
       <iframe style="width: 560px; height: 210px;border:0px!important;" src="http://www.designerssociety.net/h50-profile" scrolling="no"></iframe>
                      
    Ange Tuteur
    Ange Tuteur
    Forumaster


    Male Posts : 13207
    Reputation : 3000
    Language : English & 日本語
    Location : Pennsylvania

    In progress Re: Private Message Form Redirects to Specific Page

    Post by Ange Tuteur Mon 13 Oct - 5:09

    Replace your iframe by :
    Code:
    <iframe style="width: 560px; height: 210px;border:0px!important;" src="http://www.designerssociety.net/h50-profile"></iframe>

    You have scrolling="no" on the frame which doesn't allow you to scroll. I made a test and it loaded the profile in the frame.
    DesignersSociety
    DesignersSociety
    Forumember


    Female Posts : 146
    Reputation : 3
    Language : english

    In progress Re: Private Message Form Redirects to Specific Page

    Post by DesignersSociety Mon 13 Oct - 9:16

    Thank you I actually had scripts set allowed in a past version which didn't work, after removing that it worked. One last question... is there a way to do the redirecting to any link, but with editing and clicking save on your profile?
    Ange Tuteur
    Ange Tuteur
    Forumaster


    Male Posts : 13207
    Reputation : 3000
    Language : English & 日本語
    Location : Pennsylvania

    In progress Re: Private Message Form Redirects to Specific Page

    Post by Ange Tuteur Mon 13 Oct - 17:09

    DesignersSociety wrote:Thank you I actually had scripts set allowed in a past version which didn't work, after removing that it worked. One last question... is there a way to do the redirecting to any link, but with editing and clicking save on your profile?
    See if this works :

    Administration Panel > Modules > JavaScript codes management > Create a new script

    Title : Your choice
    Placement : In all the pages
    Paste the code below :
    Code:
    $(function(){$('form#register[action="/profile"]').submit(function() { localStorage.postPr = true })});
    if (localStorage.postPr) {
     Â location.pathname = '/h1-';
     Â localStorage.removeItem('postPr');
    }
    DesignersSociety
    DesignersSociety
    Forumember


    Female Posts : 146
    Reputation : 3
    Language : english

    In progress Re: Private Message Form Redirects to Specific Page

    Post by DesignersSociety Mon 13 Oct - 20:16

    Hmm nope it didn't work
    Ange Tuteur
    Ange Tuteur
    Forumaster


    Male Posts : 13207
    Reputation : 3000
    Language : English & 日本語
    Location : Pennsylvania

    In progress Re: Private Message Form Redirects to Specific Page

    Post by Ange Tuteur Mon 13 Oct - 20:56

    Is this for the default profile settings ? ex : /profile?mode=editprofile
    DesignersSociety
    DesignersSociety
    Forumember


    Female Posts : 146
    Reputation : 3
    Language : english

    In progress Re: Private Message Form Redirects to Specific Page

    Post by DesignersSociety Mon 13 Oct - 21:32

    I'm actually adding it to a different page like so... <center><span id="profileedit" align="center"></span></center>
      
    <script>$('#profileedit').load('/profile?mode=editprofile .three-col')
                                          </script>
    Ange Tuteur
    Ange Tuteur
    Forumaster


    Male Posts : 13207
    Reputation : 3000
    Language : English & 日本語
    Location : Pennsylvania

    In progress Re: Private Message Form Redirects to Specific Page

    Post by Ange Tuteur Tue 14 Oct - 2:12

    You might need to bind the event. So, try replacing the script by this :
    Code:
    $(function(){$('form#register[action="/profile"]').on('submit',function() { localStorage.postPr = true })});
    if (localStorage.postPr) {
      location.pathname = '/h1-';
      localStorage.removeItem('postPr');
    }

      Current date/time is Sun 22 Sep - 18:37