Private Message Form Redirects to Specific Page

Go down

In progress Private Message Form Redirects to Specific Page

Post by DesignersSociety on Thu Oct 09, 2014 4:41 pm

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"
avatar
DesignersSociety
Forumember

Female Posts : 133
Reputation : 3
Language : english

http://designerssociety.betaboard.net

Back to top Go down

In progress Re: Private Message Form Redirects to Specific Page

Post by SLGray on Thu Oct 09, 2014 5:17 pm

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


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

avatar
SLGray
Administrator
Administrator

Male Posts : 43520
Reputation : 3094
Language : English
Location : United States

http://fmthemesdesignteam.forumotion.com/

Back to top Go down

In progress Re: Private Message Form Redirects to Specific Page

Post by _Twisted_Mods_ on Thu Oct 09, 2014 5:28 pm

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
avatar
_Twisted_Mods_
Helper
Helper

Male Posts : 2064
Reputation : 314
Language : English
Location : Ms

http://liquidcode.forumotion.com

Back to top Go down

In progress Re: Private Message Form Redirects to Specific Page

Post by DesignersSociety on Thu Oct 09, 2014 6:22 pm

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

Female Posts : 133
Reputation : 3
Language : english

http://designerssociety.betaboard.net

Back to top Go down

In progress Re: Private Message Form Redirects to Specific Page

Post by DesignersSociety on Sun Oct 12, 2014 11:31 am

Bump
avatar
DesignersSociety
Forumember

Female Posts : 133
Reputation : 3
Language : english

http://designerssociety.betaboard.net

Back to top Go down

In progress Re: Private Message Form Redirects to Specific Page

Post by Ange Tuteur on Sun Oct 12, 2014 4:22 pm

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.
avatar
Ange Tuteur
Forumaster

Male Posts : 13202
Reputation : 2918
Language : EN10, FR5, JA5
Location : Macungie, PA

https://github.com/SethClydesdale

Back to top Go down

In progress Re: Private Message Form Redirects to Specific Page

Post by DesignersSociety on Sun Oct 12, 2014 8:27 pm

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>
                  
avatar
DesignersSociety
Forumember

Female Posts : 133
Reputation : 3
Language : english

http://designerssociety.betaboard.net

Back to top Go down

In progress Re: Private Message Form Redirects to Specific Page

Post by Ange Tuteur on Sun Oct 12, 2014 10:09 pm

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.
avatar
Ange Tuteur
Forumaster

Male Posts : 13202
Reputation : 2918
Language : EN10, FR5, JA5
Location : Macungie, PA

https://github.com/SethClydesdale

Back to top Go down

In progress Re: Private Message Form Redirects to Specific Page

Post by DesignersSociety on Mon Oct 13, 2014 2:16 am

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?
avatar
DesignersSociety
Forumember

Female Posts : 133
Reputation : 3
Language : english

http://designerssociety.betaboard.net

Back to top Go down

In progress Re: Private Message Form Redirects to Specific Page

Post by Ange Tuteur on Mon Oct 13, 2014 10:09 am

@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');
}
avatar
Ange Tuteur
Forumaster

Male Posts : 13202
Reputation : 2918
Language : EN10, FR5, JA5
Location : Macungie, PA

https://github.com/SethClydesdale

Back to top Go down

In progress Re: Private Message Form Redirects to Specific Page

Post by DesignersSociety on Mon Oct 13, 2014 1:16 pm

Hmm nope it didn't work
avatar
DesignersSociety
Forumember

Female Posts : 133
Reputation : 3
Language : english

http://designerssociety.betaboard.net

Back to top Go down

In progress Re: Private Message Form Redirects to Specific Page

Post by Ange Tuteur on Mon Oct 13, 2014 1:56 pm

Is this for the default profile settings ? ex : /profile?mode=editprofile
avatar
Ange Tuteur
Forumaster

Male Posts : 13202
Reputation : 2918
Language : EN10, FR5, JA5
Location : Macungie, PA

https://github.com/SethClydesdale

Back to top Go down

In progress Re: Private Message Form Redirects to Specific Page

Post by DesignersSociety on Mon Oct 13, 2014 2:32 pm

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>
avatar
DesignersSociety
Forumember

Female Posts : 133
Reputation : 3
Language : english

http://designerssociety.betaboard.net

Back to top Go down

In progress Re: Private Message Form Redirects to Specific Page

Post by Ange Tuteur on Mon Oct 13, 2014 7:12 pm

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');
}
avatar
Ange Tuteur
Forumaster

Male Posts : 13202
Reputation : 2918
Language : EN10, FR5, JA5
Location : Macungie, PA

https://github.com/SethClydesdale

Back to top Go down

Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum