No announcement yet.

Submit on "enter" - Gift Registry access

  • Filter
  • Time
  • Show
Clear All
new posts

  • Submit on "enter" - Gift Registry access

    HI Everyone, forgive me if the solution to this problem has already been posted. I have searched the forum and have been unable to find it.

    I need to make the gift registry entry button work when a user hits "enter" on their keyboard. Currently it only works if someone presses the "search" button. I have tested this with many users internally and outside our company, and users consistently run into a problem because of this issue.

    While I can find solutions online for the javascript, I am not adept enough to be sure that I am modifying the code correctly.

    I am using the gift registry in a unique way already, in that I am using it as a private team page.

    I believe that I need to alter the javascript on the gift_registry_home page, but I don't know exactly how.

    Any thoughts?

    Stadium System, Inc.
    Last edited by JenCat; 01-16-2013, 01:24 PM.

  • #2
    Are you using the stock gift_registry_home template file, or do you have a modified version inside your Template's folder?


    • #3
      I was using a modified version of the gift_regsitry_home, but now I am trying to revert to the original version. Now I cannot even access the registry by clicking on the button.

      Here is the link to the page

      Welcome to Stadium System - Full-Service Athletic Equipment Dealer & Reconditioner Since 1948

      Is there some restriction on the number of people that can be in a gift registry at once? If so, that is not good.


      • #4
        To revert to the original version, just rename your customized version something different (gift_registry_home-custom-backup.html or something). That will force the system to use the 'common/default' version

        Then clear your cache for good measure

        No, there is no restriction to simultaneous users.

        It is hard for me to test this page because I am not sure how it is supposed to be used, or what code to enter.


        • #5
          Got your PM with the code.

          When I try to use it I get a javascript error that viewRegistry() is not defined.

          If you replace this with the common file properly that should not be a problem. That file (giftregistry_home.html) has that function defined within it.

          Did you try renaming all of the giftregistry-related files to force the template to use the common version?


          • #6
            Ok I did just rename all the gift registry files. I will see if I can send a screenshot to you via PM.

            I then cleared my cache and reloaded the site... still no go.

            Not sure where I am going wrong.


            • #7
              OK, wow... I just figured out where the problem was coming from... it was in "store language" setting.

              In an effort to make people really see that they had to CLICK the enter button, I had put in my store text the following

              Enter code and click "view team sales"


              I think the quotes were causing the problem. Because I just changed it to say only be Enter code and Click

              and now it works

              Welcome to Stadium System - Full-Service Athletic Equipment Dealer & Reconditioner Since 1948

              Of course, now I am back with the original problem, where I need to make sure this works when someone presses enter, and not only when they click on the button.

              So, i think I need som kind of modified javascript for a submit on enter


              • #8
                The link above "Enter code and click" now works for me when hitting enter

                However the form where you search for your team still seems to require a click.

                So is this an improvement over what it was before?


                • #9
                  Well for me, it is not working correctly. If I press "enter, it brings me to this page:

                  Welcome to Stadium System - Full-Service Athletic Equipment Dealer & Reconditioner Since 1948

                  Now go back to the orginal page and press the "Click Here" button with your mouse (after entering your code) and it should bring you to a list of the items for that team.

                  That's what I need the page to go to when someone presses enter on their keyboard. ... it needs to lead them to the view_giftregistry page.


                  • #10
                    It is hard for me to test a solution since I don't really use a page like this. But I have narrowed it down to one line:

                    The file is giftregister_home_password.html

                    The line in question is
                    <input type="button" name="cmdViewList" onClick="javascript:viewRegistry('[custid]');" class="btn" value="[giftregistry_home-select-registry]" onMouseOver="this.className='btn_over'" onMouseOut="this.className='btn'">
                    try changing it to:

                    <input type="button" name="cmdViewList" onSubmit="javascript:viewRegistry('[custid]');" class="btn" value="[giftregistry_home-select-registry]" onMouseOver="this.className='btn_over'" onMouseOut="this.className='btn'">


                    • #11
                      Thank you so much. So, I made that change, and when I "inspect element" using chrome, I see that I have made the change correctly.

                      Now I think there is just one more issue to fix. The page is picking the first link on the page, instead of the button, when pressing submit.

                      I will send you a screen shot separately, but basically the issue is that the Enter button is registering the "Gift Registry Home", which I would like to remove altogether from this page anyway. (I don't want people seeing the "gift" registry part). If I can get rid of that, then I think pressing "enter" will work correctly.

                      Any thoughts on where I access that??

                      here the page I am referring to...

                      Welcome to Stadium System - Full-Service Athletic Equipment Dealer & Reconditioner Since 1948


                      • #12
                        Sorry, can you re-write your last post for clarity? I am having a really hard time following what you mean.


                        • #13
                          Sorry for the confusion.

                          Let me try again.

                          When I changed the code for the button as you stated in a previous post, to be onSubmit... it didn't do anything. In fact, it made it so that the button was no longer "clickable".

                          So, I had to keep that as "onClick". ...

                          I think maybe the code that has to be changed is at the top of the page, perhaps in conjunction with what you suggested. I just know there has to be a way to make the "click here" button work when pressing enter.

                          HTML Code:
                          <form action="giftregistry_home.asp" name="frmForm" id="frmForm" method="post" autocomplete="off">
                          	<input type="hidden" name="action" id="action" value="">
                          	<input type="hidden" name="intCustId" id="intCustId" value="">


                          • #14
                            its submitting on enter for me.

                            lets say its not for everyone for the sake of argument. This is what i would do.

                            jQuery('input[name="txtRegPassword"]').on('keyup", function(evt){
                               if(jQuery(this).value.length >=0){
                                    if(evt.keyCode == 13 || evt.keyCode == 169){
                            Now for the breakdown. This code will attach a listener for the input box you are entering into. Every time a key is pressed, it will check to see if there is a value in the box and that its not blank. If it is not blank, it will then check to see if the key last pressed (thus the keyUP command is when someone presses a key and then lets it go) is the enter key. (13 is the main enter key and 169 is the enter key on the number pad.. hopefully.. i googled.) If it is indeed the enter key, it submits the form. If not, nothing.
                            Last edited by jleclair; 01-16-2013, 03:42 PM.


                            • #15
                              Thanks so much. I am eager to give that a try. Where on the page should I put the jquery code? Also, should I be placing is on the gift_registry_password.html page?