Security

last person joined: yesterday 

Forum to discuss Enterprise security using HPE Aruba Networking NAC solutions (ClearPass), Introspect, VIA, 360 Security Exchange, Extensions, and Policy Enforcement Firewall (PEF).
Expand all | Collapse all

Pre-populated Sponsor Email Field

This thread has been viewed 3 times
  • 1.  Pre-populated Sponsor Email Field

    Posted Mar 18, 2013 06:59 PM

    We have everything working great.  The only thing I'd like to improve on is in the Sponsor's email field.  We pre-populate this field with @mycompany.com.  When the user tabs down to it they are placed at the end of this text.  I would like to place them at the beginning of the text so they just have to type the sponsor's name and not have to cursor to the front then type.



  • 2.  RE: Pre-populated Sponsor Email Field
    Best Answer

    Posted Mar 19, 2013 03:11 AM

    Interesting use case...  Seems like you need some JavaScript to do this.

     

    The following seems to do the job – paste it into the Footer HTML of the registration form.  You'll need to make an obvious change (change the @mycompany.com string to whatever your Initial Value is).  Works OK on Firefox and Chrome, I did not test it on Internet Explorer:

     

    <script type="text/javascript">{literal}
    (function () {
      var f = document.forms[0].sponsor_email;
      f.onfocus = function () {
        if (f.value == "@mycompany.com") {
          window.setTimeout(function () {
            if (f.createTextRange) {
              var range = f.createTextRange();
              range.collapse(true);
              range.select();
            } else if (f.setSelectionRange) {
              f.setSelectionRange(0, 0);
            } else if (typeof f.selectionStart != "undefined") {
              f.selectionStart = f.selectionEnd = 0;
            }
          },1);
        }
      };
    })();
    {/literal}</script>

     

    Credit:  Thanks to this Stack Overflow article for the basic text range code tips.


  • 3.  RE: Pre-populated Sponsor Email Field

    Posted Mar 19, 2013 08:01 AM

    Thanks, I'll give it a try and let you know how I make out.



  • 4.  RE: Pre-populated Sponsor Email Field

    Posted Mar 25, 2013 09:02 AM

    Works on IE as well.  Thanks for your help.



  • 5.  RE: Pre-populated Sponsor Email Field

    Posted Mar 25, 2013 09:06 AM

    wmccall - just a followup question.

    How does this work for you? Does the guest have to input the exact correct email adress, or the exact correct name as it's listed in AD? I've been unable to get wildcard to work in this field..



  • 6.  RE: Pre-populated Sponsor Email Field

    Posted Mar 26, 2013 03:22 PM

    This is working as advertised and it makes it look a little more polished and cleaner for the guest.  Tabing through the fields and being placed in front of the @mycompany.com the guest types in the exact first_lastname (this is how our email addresses are formatted) of the company sponsor with the end result looking like first_lastname@mycompany.com  We didn't go as far as being able to search for a user as we didn't want our emails to be made public.



  • 7.  RE: Pre-populated Sponsor Email Field

    MVP
    Posted Apr 04, 2013 04:46 PM

    yea, it would be very nice if it were possible to easely link this field to for example ldap and than have it populate a dropdown list with members from a group or something.

     

    Luckely our company isn't too big so I manualy created the dropdownlist containign all our people for the demo unit we have running actively to show off some stuff.

    For bigger companies a subdivission per department or something would be nice too.



  • 8.  RE: Pre-populated Sponsor Email Field

    Posted Apr 10, 2013 11:24 AM

    Watch this space, we will be looking at adding LDAP/AD search in a future version.  Our 6.1 release will include this capability for Airgroup and we are hoping to port it to sponsor approval subsequently.  As mentioned by OP some customers will not want to populate that information on a public facing registration page but is a good feature enhancement.

     

    carlos