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.

Private Message Form Redirects to Specific Page

4 posters

Go down

In progress Private Message Form Redirects to Specific Page

Post by DesignersSociety October 9th 2014, 11: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"
DesignersSociety
DesignersSociety
Forumember

Female Posts : 146
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 October 10th 2014, 12:17 am

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.
SLGray
SLGray
Administrator
Administrator

Male Posts : 51567
Reputation : 3525
Language : English
Location : United States

https://forumsclub.com/gc/128-link-directory/

Back to top Go down

In progress Re: Private Message Form Redirects to Specific Page

Post by _Twisted_Mods_ October 10th 2014, 12:28 am

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

Male Posts : 2083
Reputation : 336
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 October 10th 2014, 1:22 am

@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

http://designerssociety.betaboard.net

Back to top Go down

In progress Re: Private Message Form Redirects to Specific Page

Post by DesignersSociety October 12th 2014, 6:31 pm

Bump
DesignersSociety
DesignersSociety
Forumember

Female Posts : 146
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 October 12th 2014, 11: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.
Ange Tuteur
Ange Tuteur
Forumaster

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

https://fmdesign.forumotion.com

Back to top Go down

In progress Re: Private Message Form Redirects to Specific Page

Post by DesignersSociety October 13th 2014, 3:27 am

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

Female Posts : 146
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 October 13th 2014, 5:09 am

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

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

https://fmdesign.forumotion.com

Back to top Go down

In progress Re: Private Message Form Redirects to Specific Page

Post by DesignersSociety October 13th 2014, 9: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?
DesignersSociety
DesignersSociety
Forumember

Female Posts : 146
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 October 13th 2014, 5:09 pm

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

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

https://fmdesign.forumotion.com

Back to top Go down

In progress Re: Private Message Form Redirects to Specific Page

Post by DesignersSociety October 13th 2014, 8:16 pm

Hmm nope it didn't work
DesignersSociety
DesignersSociety
Forumember

Female Posts : 146
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 October 13th 2014, 8:56 pm

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

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

https://fmdesign.forumotion.com

Back to top Go down

In progress Re: Private Message Form Redirects to Specific Page

Post by DesignersSociety October 13th 2014, 9: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>
DesignersSociety
DesignersSociety
Forumember

Female Posts : 146
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 October 14th 2014, 2:12 am

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

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

https://fmdesign.forumotion.com

Back to top Go down

Back to top

- Similar topics

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