closed Form Validation

nate
@nate
8 years ago
917 posts
Is there any way to get my custom sign up form to validate?

{jrCore_module_url module="jrUser" assign="uurl"}
                            <form id="jrUser_signup" class="jrform" enctype="multipart/form-data" accept-charset="utf-8" method="post" action="{$jamroom_url}/{$uurl}/signup_save" name="jrUser_signup">
                                {$token = jrCore_form_token_create()}
                                <input type="hidden" value="{$token}" name="jr_html_form_token" id="jr_html_form_token">
                                <input type="text" tabindex="1" placeholder="Create a Username" name="user_name" class="form_text" id="user_name"><br>
                                <input type="text" tabindex="2" placeholder="Email Address" value="" name="user_email" class="form_text" id="user_email"><br>
                                <input type="password" tabindex="3" placeholder="Password" name="user_passwd1" class="form_text" id="user_passwd1"><br>
                                <input type="password" tabindex="4"  placeholder="Repeat Password" onkeypress="if (event &amp;&amp; event.keyCode == 13 &amp;&amp; this.value.length &gt; 0) { jrFormSubmit('#jrUser_signup','{$token}','ajax'); }" value="" name="user_passwd2" class="form_text" id="user_passwd2">
                                <div class="split">
                                    {jrCore_module_url module="jrImage" assign="url"}
                                    <img id="form_submit_indicator" src="{$jamroom_url}/{$url}/img/skin/{$_conf.jrCore_active_skin}/submit.gif" width="24" height="24" alt="{jrCore_lang module="jrCore" id="73" default="working..."}">
                                    <button id="jrUser_signup_submit" type="button" onclick="jrFormSubmit('#jrUser_signup','{$token}','ajax');">Join</button>
                                </div>
                                <div class="split">
                                    <button type="button" class="login" onclick="jrCore_window_location('{$jamroom_url}/{$uurl}/login')">{jrCore_lang skin=$_conf.jrCore_active_skin id=100 default="or Log in"}</button>
                                </div>
                            </form>

Quote: {"notices":[{"type":"error","text":"Invalid Form Validation received - please refresh and try again."
}] }

updated by @nate: 08/12/16 03:12:21AM
brian
@brian
8 years ago
10,148 posts
Yes - all JR forms must include a form token - i.e.

{jrCore_form_token assign="token"}
<input type="hidden" id="jr_html_form_token" name="jr_html_form_token" value="{$token}">

Let me know of that helps.


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
nate
@nate
8 years ago
917 posts
That was already there. I'm gonna assume there's another problem.

http://n8flex.com/core/form_validate/__ajax=1

Quote: jr_html_form_token
2d1a8b8229813fd7cea2e92bc8b7d657
user_email
demo6@demo.com
user_name
Demo
user_passwd1
demo
user_passwd2
demo

jr_html_form_token=2d1a8b8229813fd7cea2e92bc8b7d657&user_name=Demo&user_email=demo6%40demo.com&user_passwd1
=demo&user_passwd2=demo

updated by @nate: 05/03/16 02:48:16PM
nate
@nate
8 years ago
917 posts
And yes I updated my code and I get the same result.

Quote: {"notices":[{"type":"error","text":"Invalid Form Validation received - please refresh and try again."
}] }
brian
@brian
8 years ago
10,148 posts
This means there is no form session - just looked closer at this and you'll need to setup one in your template instead of using {jrCore_form_token} - i.e.

{jrCore_form_create_session module="jrUser" option="signup" assign="token"}
<input type="hidden" id="jr_html_form_token" name="jr_html_form_token" value="{$token}">

I think that should work.


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
nate
@nate
8 years ago
917 posts
I'm pretty sure this will work. Thanks again. Releasing my 3rd skin tomorrow. Planning on 9 more.

Gotta run for a bit.
nate
@nate
8 years ago
917 posts
OK there is a problem, form_view and form_fields are not being created in the form_session table.
nate
@nate
8 years ago
917 posts
I'm guessing this isn't gonna work.
nate
@nate
8 years ago
917 posts
I tried a sign up widget but that had other issues. I finally came up with this as an alternate.

{if jrCore_module_is_active('jrOneAll')}
          <script src="{$_conf.jrOneAll_domain}/socialize/library.js?v=1.8.4" type="text/javascript"></script>
{/if}
{jrCore_array name='widget_data' key='type' value="login"}
{jrCore_array name='widget' key='widget_data' value=$widget_data}
{jrUser_widget_login_display($widget)}

Tags