Page 1 of 2 12 LastLast
Results 1 to 10 of 14
  1. #1
    Join Date
    Aug 2007
    Location
    Gijón, Asturias, Spain
    Posts
    2,571
    Plugin Contributions
    30

    Default [Done v1.3.9c] javascript validation of edit account form

    v.139b - vanilla

    It appears that the javascript validation is not working on edit account as I never see the popup error messages, only the php ones. The code on create account works.

    I see there is new code in there with a keyword of optional, so is there something I should be switching on somewhere?

    Steve

  2. #2
    Join Date
    Jan 2004
    Posts
    66,364
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: javascript validation of edit account form

    I just tested it on a fresh v1.3.9b install, and I get the javascript popups on appropriate fields when using main_page=account_edit

    Maybe you're missing some files from your server?
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  3. #3
    Join Date
    Aug 2007
    Location
    Gijón, Asturias, Spain
    Posts
    2,571
    Plugin Contributions
    30

    Default Re: javascript validation of edit account form

    I knew you would say that..

    This is a local install (xampp 173, php5.3) done specifically to look at this problem I found with my dev shop so it has no mods whatsoever.
    This error occurs without even going into the admin once to change anything.

    Anyway after a lot of breakpointing I find that this snippet in
    \includes\modules\pages\account_edit\jscript_form_check.php
    is responsible for the whole error-checking routine popping out of sequence.
    PHP Code:
    <?php if (ACCOUNT_STATE == 'true') echo '  if (!form.state.disabled && form.zone_id.value == "") check_input("state", ' . (int)ENTRY_STATE_MIN_LENGTH ', "' ENTRY_STATE_ERROR '")' "\n" '  else if (form.state.disabled) check_select("zone_id", "", "' ENTRY_STATE_ERROR_SELECT '");' "\n"?>
    If I delete this, everything works correctly.
    I note that in 138a this snippet of code is not in the edit account javascript whereas in 139 the jscript code is identical between create account and edit account.

    I get this error in FF, IE, Opera, Chrome.
    Create Account and Create Account split login work ok.

    Steve

  4. #4
    Join Date
    Jan 2004
    Posts
    66,364
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: javascript validation of edit account form

    It's safe to delete that line.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  5. #5
    Join Date
    Aug 2007
    Location
    Gijón, Asturias, Spain
    Posts
    2,571
    Plugin Contributions
    30

    Default Re: javascript validation of edit account form

    weeeel yes, I agree it does not do anything in this context but I just can't help having to know why I am the only one with this issue...
    or why the code is there is the first place..

    thanks
    Steve

  6. #6
    Join Date
    Jan 2004
    Posts
    66,364
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: javascript validation of edit account form

    Actually, you're not the only one having this "issue". I did some further testing and replicated the problem myself.

    1. The real problem is that the form field names didn't have quotes put around them in the tests. That'll be fixed in a newer version.
    2. The javascript bug doesn't prevent proper form validation. It merely makes the user wait a moment longer for the display of an error message if one exists.

    As to your "why the code is there in the first place" question,
    3. The javascript file was updated because of a number of people complaining that it didn't do proper validation if min-length was set to 0 or blank on some forms. And, since the same validation javascript is used in multiple pages, the update was applied to all pages, so that the files are consistent. Unfortunately the missing quotes got copied to all pages too.

    So, yes, it's a bug. A tiny fairly inconsequential one, but a bug nonetheless.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  7. #7
    Join Date
    Jan 2007
    Posts
    1,484
    Plugin Contributions
    10

    Default Re: [Done] javascript validation of edit account form

    Could you please post the correct fix for this bug? I am keeping track of all new bugs in 1.3.9b to correct them as soon as they are identified to keep the code as bug free as possible. I have 13 new sites I am developing over the next couple of months.

    Thanks! And thanks again for the great software!!!

    Zen Cart and it's community are the best!!

  8. #8
    Join Date
    Jan 2004
    Posts
    66,364
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: [Done] javascript validation of edit account form

    You can fix it by simply deleting the line we discussed above from the filename mentioned.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  9. #9
    Join Date
    Jan 2007
    Posts
    1,484
    Plugin Contributions
    10

    Default Re: [Done] javascript validation of edit account form

    OK, I thought it would be best to add the quotes around the form field names to preserve the original code but if deleting that line doesn't affect functionality I will do that instead. Do you know what other files(if any) are affected by the same bug? Thanks DB!!

    Zen Cart and it's community are the best!!

  10. #10
    Join Date
    Jan 2007
    Posts
    1,484
    Plugin Contributions
    10

    Default Re: [Done] javascript validation of edit account form

    Quote Originally Posted by lankeeyankee View Post
    Do you know what other files(if any) are affected by the same bug?
    Using the trusty ol' developer's toolkit(what a great tool btw!!!) this is the list of affected files that I can determine:

    /includes/modules/pages/address_book_process/jscript_main.php

    /includes/modules/pages/checkout_payment_address/jscript_main.php

    /includes/modules/pages/checkout_shipping_address/jscript_main.php

    /includes/modules/pages/create_account/jscript_form_check.php

    /includes/modules/pages/login/jscript_form_check.php

    /includes/modules/pages/no_account/jscript_form_check.php

    Zen Cart and it's community are the best!!

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. Replies: 2
    Last Post: 1 Aug 2015, 10:40 PM
  2. Modifying Create Account Registration Form - can it be done?
    By shags38 in forum Managing Customers and Orders
    Replies: 3
    Last Post: 17 Nov 2011, 04:33 AM
  3. Javascript validation of extra field in create edit account
    By torvista in forum Templates, Stylesheets, Page Layout
    Replies: 5
    Last Post: 20 Jul 2010, 11:25 PM
  4. Form Validation Javascript!
    By voyager in forum Templates, Stylesheets, Page Layout
    Replies: 7
    Last Post: 23 Oct 2009, 03:29 PM
  5. Replies: 2
    Last Post: 19 Aug 2006, 09:01 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR