Page 1 of 1

[solved]NMS set returnid

Posted: Sun Sep 18, 2011 4:15 pm
by aleksanderlech
Hello.
I developed a page with NMS subscribe form, but form itself is placed in small area surrounded by graphic elements.
I need to redirect all NMS messages to page other than the form is put on.

There is hidden field "returnid" with value of page with NMS form, is there a way to set its value to other page? Or to set NMS form action to given page?

Greetings
Aleksander

Re: NMS set returnid

Posted: Mon Sep 19, 2011 12:13 am
by applejack
Try using replace

i.e. {$formhidden|replace:'returnid" value="15"':'returnid" value="18"'}

Re: NMS set returnid

Posted: Mon Sep 19, 2011 4:18 am
by aleksanderlech
@applejack
thank you for your information, however this:

Code: Select all

	
	{$formstart}
{if $message ne ""}
	<span class="nms_message">{$message}</span>
	{/if}
                {$formhidden|replace:'returnid" value="15"':'returnid" value="68"'}
		{$formhidden}
Doesn't work.

Greetz

Re: NMS set returnid

Posted: Mon Sep 19, 2011 11:09 am
by applejack
Is your actual returnid 15 ?

Re: NMS set returnid

Posted: Mon Sep 19, 2011 11:38 am
by aleksanderlech
yep.
This is how it looks:

Code: Select all

<form id="md4e46moduleform_1" method="post" action="_ill better keep it secret now_" class="cms_form">
<div class="hidden">
<input type="hidden" name="mact" value="NMS,md4e46,do_create_new_user,1" />
<input type="hidden" name="md4e46returnid" value="15" />
<input type="hidden" name="page" value="15" />
</div>
<input type="hidden" name="md4e46lists[]" value="1" />
<input type="hidden" name="md4e46lists[]" value="1" />
<label>twoje imię</label><input type="text" class="cms_textfield" name="md4e46username" id="md4e46username" value="" size="30" maxlength="150" />
<br />
<label>adres e-mail</label><input type="text" class="cms_textfield" name="md4e46email" id="md4e46email" value="" size="30" maxlength="150" />
<br />
<input class="cms_submit" name="md4e46submit" id="md4e46submit" value="Zatwierdź" type="submit" />
</form>
Aleksander

Re: NMS set returnid

Posted: Mon Sep 19, 2011 12:40 pm
by applejack
Sorry do the replace on the {$formstart}

If you just replace the returnid it will go to the correct page but will not show that URL in the address bar. If you need to show the URL in the address bar then you also need to replace the end part of the action. These will only work if the sign up form is on one specific page. If it is on multiple page then you will have to use regex_replace which is what I use to set the email confirmation return page to a specific page i.e.

{$confirmurl|regex_replace:"/\/NMS\/\d+\//":"/NMS/73/"}

Re: NMS set returnid

Posted: Mon Sep 19, 2011 12:56 pm
by aleksanderlech
Thank you - that worked :)
Form is on one page only so there's no need to regex enything.

Best regards
Aleksander