The forum of the forums
Welcome to the Official Support Forum of Forumotion!

To take full advantage of everything offered by our forum, please log in if you are already a member, or join our community if you've not yet.



Create a free forum like this one.

Private Message Form Redirects to Specific Page

View previous topic View next topic Go down

In progress Private Message Form Redirects to Specific Page

Post by DesignersSociety on Fri 10 Oct - 0: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"
avatar
DesignersSociety
Forumember

Female Posts : 121
Reputation : 2
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 Fri 10 Oct - 1:17

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 : 40857
Reputation : 2773
Language : English
Location : United States

https://fmthemes.forumotion.com/

Back to top Go down

In progress Re: Private Message Form Redirects to Specific Page

Post by _Twisted_Mods_ on Fri 10 Oct - 1:28

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

http://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 Fri 10 Oct - 2: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.
avatar
DesignersSociety
Forumember

Female Posts : 121
Reputation : 2
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 12 Oct - 19:31

Bump
avatar
DesignersSociety
Forumember

Female Posts : 121
Reputation : 2
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 13 Oct - 0: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.
avatar
Ange Tuteur
Forumaster

Male Posts : 13176
Reputation : 2881
Language : EN10, FR5
Location : Macungie, PA

http://fmdesign.forumotion.com

Back to top Go down

In progress Re: Private Message Form Redirects to Specific Page

Post by DesignersSociety on Mon 13 Oct - 4: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>
avatar
DesignersSociety
Forumember

Female Posts : 121
Reputation : 2
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 13 Oct - 6: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.
avatar
Ange Tuteur
Forumaster

Male Posts : 13176
Reputation : 2881
Language : EN10, FR5
Location : Macungie, PA

http://fmdesign.forumotion.com

Back to top Go down

In progress Re: Private Message Form Redirects to Specific Page

Post by DesignersSociety on Mon 13 Oct - 10: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?
avatar
DesignersSociety
Forumember

Female Posts : 121
Reputation : 2
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 13 Oct - 18: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');
}
avatar
Ange Tuteur
Forumaster

Male Posts : 13176
Reputation : 2881
Language : EN10, FR5
Location : Macungie, PA

http://fmdesign.forumotion.com

Back to top Go down

In progress Re: Private Message Form Redirects to Specific Page

Post by DesignersSociety on Mon 13 Oct - 21:16

Hmm nope it didn't work
avatar
DesignersSociety
Forumember

Female Posts : 121
Reputation : 2
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 13 Oct - 21:56

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

Male Posts : 13176
Reputation : 2881
Language : EN10, FR5
Location : Macungie, PA

http://fmdesign.forumotion.com

Back to top Go down

In progress Re: Private Message Form Redirects to Specific Page

Post by DesignersSociety on Mon 13 Oct - 22: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>
avatar
DesignersSociety
Forumember

Female Posts : 121
Reputation : 2
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 Tue 14 Oct - 3: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');
}
avatar
Ange Tuteur
Forumaster

Male Posts : 13176
Reputation : 2881
Language : EN10, FR5
Location : Macungie, PA

http://fmdesign.forumotion.com

Back to top Go down

View previous topic View next topic Back to top


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