@alexsuoy wrote:
In Clearpass guest/Configuratino/Forms/mac_create there is a field called Visitor name
1). If I want to have the visitor name= mac address entered in the mac address field automatially, how do I do this so that the user only enters the mac-address
2). If I wanted the visitor nam = <userid of logged in user>-<mac address entered in mac address field> . can you do this autpomatically?
Both are possible. You can use one of the following Java Scripts.
1. Populate mac address to visitor name field.
<script type="text/JavaScript"><!--{literal}
function RegisterSubmit(mac_create) {
var frm = document.forms[mac_create];
if (frm.mac.value != '') {
var temp1= frm.mac.value;
frm.visitor_name.value=temp1;
}
return true; // Proceed to regular
}
{/literal}</script>
2. Populate logged in user + mac address to visitor_name
<script type="text/JavaScript"><!--{literal}
function RegisterSubmit(mac_create) {
var frm = document.forms[mac_create];
if (frm.sponsor_name.value != '') {
var temp1= frm.sponsor_name.value;
var temp2= frm.mac.value;
frm.visitor_name.value=temp1 + " - " + temp2;
}
return true; // Proceed to regular
}
{/literal}</script>
Notes:
- You may need to replace the "mac_create" in the above script with the correct form name, if you are not using the default mac_create form for device resgistration.
- Paste the above script in the form footer, Form > Edit > Footer HTML.
- Edit the Form fields > submit > Show Advanced Porperties > AJAZ Submit and enter "RegisterSubmit".
You can modify the fields in the script as needed. Keep the sponsor_name and visitor_name field interface type to hidden when using the script #2, sponsor_name filed interface can be static text too.
You may also refer the below article, if you have any assisatnce on how to use the script.
http://community.arubanetworks.com/t5/AAA-NAC-Guest-Access-BYOD/How-to-restrict-email-sponsor-email-field-in-guest-self/ta-p/215039