Forums / Templates, Stylesheets, Page Layout / All fields deleted when one required field is missing during sign in.

All fields deleted when one required field is missing during sign in.

Locked

Views: 1,227

Results 1 to 8 of 8
This thread is locked. New replies are disabled.
30 May 2010, 6:31 PM
#1
clueless_in_berlin avatar

clueless_in_berlin

New Zenner

Join Date:
May 2008
Posts:
48
Plugin Contributions:
0

All fields deleted when one required field is missing during sign in.

If one required field is missing when creating a new account, all of the entered fields are deleted and a new page is opened with a message such as: Please choose a salutation.

This, I find to be extremely annoying. I was wondering if anyone knows how to arrange it so that all of the entered fields remain as they have already been entered.

Can anyone help me here? Thanks in advance.

Version 1.3.8a German and English

30 May 2010, 9:34 PM
#2
dbltoe avatar

dbltoe

Totally Zenned

Join Date:
Jan 2004
Location:
N of San Antonio TX
Posts:
9,853
Plugin Contributions:
18

Re: All fields deleted when one required field is missing during sign in.

Do you get the same result in both languages?

Need a hand with Zen Cart? Hire the team at myZenCartZone.com for upgrades, repairs, and custom plugins.
Zen Cart Certified hosting at myZenCartHost.com

30 May 2010, 9:51 PM
#3
clydejones avatar

clydejones

Deceased

Join Date:
Nov 2005
Location:
Colorado Springs, CO USA
Posts:
7,017
Plugin Contributions:
12

Re: All fields deleted when one required field is missing during sign in.

clueless_in_berlin:

If one required field is missing when creating a new account, all of the entered fields are deleted and a new page is opened with a message such as: Please choose a salutation.

This, I find to be extremely annoying. I was wondering if anyone knows how to arrange it so that all of the entered fields remain as they have already been entered.

Can anyone help me here? Thanks in advance.

Version 1.3.8a German and English

That's because the input fields do not contain the variables for the information being input:

You can see this from the line of code below (the highlighted portion)

<?php echo zen_draw_input_field('firstname', '', zen_set_field_length(TABLE_CUSTOMERS, 'customers_firstname', '40') . ' id="firstname"') . (zen_not_null(ENTRY_FIRST_NAME_TEXT) ? '<span class="alert">' . ENTRY_FIRST_NAME_TEXT . '</span>': ''); ?>

What you need is the following:

<?php echo zen_draw_input_field('firstname', $firstname, zen_set_field_length(TABLE_CUSTOMERS, 'customers_firstname', '40') . ' id="firstname"') . (zen_not_null(ENTRY_FIRST_NAME_TEXT) ? '<span class="alert">' . ENTRY_FIRST_NAME_TEXT . '</span>': ''); ?>

This now contains the variable for the first name and will hold that information whatever it is.

What you'll need to do is open includes/templates/template_default/tpl_modules_create_account.php

and add the variables for each and every input field (similar to the above)

NOTE: We are sorry that Clyde is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

30 May 2010, 11:14 PM
#4
Kim avatar

Kim

Obaa-san

Join Date:
Jun 2003
Location:
West Coast, North America
Posts:
26,682
Plugin Contributions:
0

Re: All fields deleted when one required field is missing during sign in.

You shouldn't need any code changes - The code should already remember the fields even if you have to correct an error or missed a blank.

Please do not PM for support issues: a private solution doesn't benefit the community.

Be careful with unsolicited advice via email or PM - Make sure the person you are talking to is a reliable source.

31 May 2010, 12:41 PM
#5
clueless_in_berlin avatar

clueless_in_berlin

New Zenner

Join Date:
May 2008
Posts:
48
Plugin Contributions:
0

Re: All fields deleted when one required field is missing during sign in.

hi toe, thanks for the quick response. The answer is yes I get the same result in both languages. I am now working on what Clyde has recommended.

31 May 2010, 12:54 PM
#6
clueless_in_berlin avatar

clueless_in_berlin

New Zenner

Join Date:
May 2008
Posts:
48
Plugin Contributions:
0

Re: All fields deleted when one required field is missing during sign in.

clydejones:

That's because the input fields do not contain the variables for the information being input:

You can see this from the line of code below (the highlighted portion)

<?php echo zen_draw_input_field('firstname', '', zen_set_field_length(TABLE_CUSTOMERS, 'customers_firstname', '40') . ' id="firstname"') . (zen_not_null(ENTRY_FIRST_NAME_TEXT) ? '<span class="alert">' . ENTRY_FIRST_NAME_TEXT . '</span>': ''); ?>
> 
> 
> What you need is the following:
> 
> ```
<?php echo zen_draw_input_field('firstname', $firstname, zen_set_field_length(TABLE_CUSTOMERS, 'customers_firstname', '40') . ' id="firstname"') . (zen_not_null(ENTRY_FIRST_NAME_TEXT) ? '<span class="alert">' . ENTRY_FIRST_NAME_TEXT . '</span>': ''); ?>

This now contains the variable for the first name and will hold that information whatever it is.

What you'll need to do is open includes/templates/template_default/tpl_modules_create_account.php

and add the variables for each and every input field (similar to the above)

Hi, thanks for the quick answer. I am going to try this out right now. One problem though. I didn´t find the file under includes/templates/template_default. I only found includes/templates/template_default/templates/tpl_modules_create_account.php. Is that a problem?

Also, is this something I should be doing with the override system so that updates won´t be a problem? If so, could you please help me out with the file path? Would it be includes/templates/template_default/templates/MY_TEMPLATE/tpl_modules_create_account.php?

Thanks for the help.

31 May 2010, 2:57 PM
#7
clueless_in_berlin avatar

clueless_in_berlin

New Zenner

Join Date:
May 2008
Posts:
48
Plugin Contributions:
0

Re: All fields deleted when one required field is missing during sign in.

o.k. so I did what clydejones recommended and it worked ... for the most part. Thanks Clyde

I have presently one problem though. I can´t get the radio button for the gender to work. When I have the "Mr." selected, it switches it to "Ms." when the page is reloaded. Below is the code from my includes/templates/template_default/templates/tpl_modules_create_account.php:

<?php echo zen_draw_radio_field('gender', 'm', $gender, 'id="gender-male"') . '<label class="radioButtonLabel" for="gender-male">' . MALE . '</label>' . zen_draw_radio_field('gender', 'f', $gender, 'id="gender-female"') . '<label class="radioButtonLabel" for="gender-female">' . FEMALE . '</label>' . (zen_not_null(ENTRY_GENDER_TEXT) ? '<span class="alert">' . ENTRY_GENDER_TEXT . '</span>': ''); ?> <br class="clearBoth" />

In the code above, I replaced ' ' with $gender. That´s the only change I made. Is there something else I can do to make it work properly?

I also have another related question. I added the variables for the "password" and "confirm password" fields. Now the code remembers these fields when another field is blank or incorrect, and fills it in automatically. Does this create a security problem? Should the customer always have to re-enter the password and confirm password? Or is it o.k. if these fields are also remembered?

Thanks in advance for any help!

31 May 2010, 4:07 PM
#8
clueless_in_berlin avatar

clueless_in_berlin

New Zenner

Join Date:
May 2008
Posts:
48
Plugin Contributions:
0

Re: All fields deleted when one required field is missing during sign in.

oops, oops, oops ... wait a minute. I just changed the $gender back to '' and it is now working properly. So the original code for the gender was correct.

So the first part of my last post can be ignored, but if someone has an answer to the second part regarding the "password" and "password confirm" fields, I would love to hear it.

Thanks.