<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Button which clear a form form field in Network Access Control</title>
    <link>https://community.cisco.com/t5/network-access-control/button-which-clear-a-form-form-field/m-p/3860596#M473033</link>
    <description>&lt;P&gt;it works also fine.....&lt;/P&gt;&lt;P&gt;Perfect!!!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many thanks to hslai and Jason&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kind regards&lt;/P&gt;&lt;P&gt;Jacob&lt;/P&gt;</description>
    <pubDate>Wed, 22 May 2019 03:31:49 GMT</pubDate>
    <dc:creator>jacob.parker</dc:creator>
    <dc:date>2019-05-22T03:31:49Z</dc:date>
    <item>
      <title>Button which clear a form form field</title>
      <link>https://community.cisco.com/t5/network-access-control/button-which-clear-a-form-form-field/m-p/3856970#M473011</link>
      <description>&lt;P&gt;Hi Gents,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ISE: 2.3.0.298; Patch 5&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV class="right-hand-col"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;we use a self registered guest portal.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now - i need on the "registration form" an additional button which clear the&amp;nbsp;&lt;/P&gt;&lt;P&gt;form field&amp;nbsp;"ui_person_visited" if needed.&amp;nbsp;&lt;/P&gt;&lt;P&gt;It should replace or fill in the text within the form field.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For this goal i use the following script:&lt;/P&gt;&lt;HR /&gt;&lt;P&gt;&amp;lt;script&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;jQuery('.cisco-ise-form-buttons').append("&amp;lt;div class='ui-submit ui-btn ui-shadow'&amp;gt;&amp;lt;input type='submit' value='Registration for a half year' class='hotspot-btn'/&amp;gt;&amp;lt;/div&amp;gt;");&lt;/P&gt;&lt;P&gt;jQuery('.hotspot-btn').on('click', function(evt){&lt;/P&gt;&lt;P&gt;evt.preventDefault();&lt;BR /&gt;&lt;BR /&gt;jQuery('#guestUser\\.fieldValues\\.ui_person_visited').val("");&lt;BR /&gt;jQuery('#guestUser\\.fieldValues\\.ui_person_visited').attr("placeholder","");&lt;BR /&gt;jQuery("input[name='guestUser.fieldValues.ui_person_visited']").attr("value","servicxxxx@xxxxxx.xxx")&lt;/P&gt;&lt;P&gt;});&lt;BR /&gt;&amp;lt;/script&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;HR /&gt;&lt;P&gt;This script works, if the text field of the ui_person_visited is empty after the page load.&amp;nbsp;&lt;/P&gt;&lt;P&gt;But if something is filled in like an eMail address &lt;EM&gt;(firstname@domain.com)&lt;/EM&gt; nothing happens.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Have any person an idea what is going wrong with the script?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For an early answer i will be thankfully.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kind regards&lt;/P&gt;&lt;P&gt;Jacob&lt;/P&gt;</description>
      <pubDate>Wed, 15 May 2019 17:19:26 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-access-control/button-which-clear-a-form-form-field/m-p/3856970#M473011</guid>
      <dc:creator>jacob.parker</dc:creator>
      <dc:date>2019-05-15T17:19:26Z</dc:date>
    </item>
    <item>
      <title>Re: Button which clear a form form field</title>
      <link>https://community.cisco.com/t5/network-access-control/button-which-clear-a-form-form-field/m-p/3857843#M473013</link>
      <description>&lt;P&gt;I am no expert on this but it does not look like you are clearing the form.&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;A href="http://javascript-coder.com/javascript-form/javascript-reset-form.phtml" target="_blank"&gt;Using JavaScript to reset or clear a form&lt;/A&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;might do it. For example, I copied the function and then am calling it within the function(evt).&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;&amp;lt;script&amp;gt;
&lt;FONT color="#0000FF"&gt;function clearForm(oForm) {   
  var elements = oForm.elements;
  oForm.reset();
  for(i=0; i&amp;lt;elements.length; i++) {     
	field_type = elements[i].type.toLowerCase();
	switch(field_type) {
		case "text": 
		case "password": 
		case "textarea":
	        case "hidden":
			elements[i].value = ""; 
			break;
        
		case "radio":
		case "checkbox":
  			if (elements[i].checked) {
   				elements[i].checked = false; 
			}
			break;

		case "select-one":
		case "select-multi":
            		elements[i].selectedIndex = -1;
			break;

		default: 
			break;
	}
    }
}&lt;/FONT&gt;

jQuery('.cisco-ise-form-buttons').append("&amp;lt;div class='ui-submit ui-btn ui-shadow'&amp;gt;&amp;lt;input type='submit' value='Clear Form' class='hotspot-btn'/&amp;gt;&amp;lt;/div&amp;gt;");

jQuery('.hotspot-btn').on('click', function(evt){&lt;BR /&gt;
&lt;FONT color="#FF00FF"&gt;clearForm(this.form);
&lt;/FONT&gt;evt.preventDefault();

jQuery('#guestUser\\.fieldValues\\.ui_person_visited').val("");
jQuery('#guestUser\\.fieldValues\\.ui_person_visited').attr("placeholder","");
jQuery("input[name='guestUser.fieldValues.ui_person_visited']").attr("value","servicxxxx@xxxxxx.xxx")

});
&amp;lt;/script&amp;gt;&lt;/PRE&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 16 May 2019 19:48:06 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-access-control/button-which-clear-a-form-form-field/m-p/3857843#M473013</guid>
      <dc:creator>hslai</dc:creator>
      <dc:date>2019-05-16T19:48:06Z</dc:date>
    </item>
    <item>
      <title>Re: Button which clear a form form field</title>
      <link>https://community.cisco.com/t5/network-access-control/button-which-clear-a-form-form-field/m-p/3858556#M473016</link>
      <description>let us know if it works, otherwise will have others look at it</description>
      <pubDate>Fri, 17 May 2019 19:04:20 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-access-control/button-which-clear-a-form-form-field/m-p/3858556#M473016</guid>
      <dc:creator>Jason Kunst</dc:creator>
      <dc:date>2019-05-17T19:04:20Z</dc:date>
    </item>
    <item>
      <title>Re: Button which clear a form form field</title>
      <link>https://community.cisco.com/t5/network-access-control/button-which-clear-a-form-form-field/m-p/3859388#M473020</link>
      <description>&lt;P&gt;Hello hslai,&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;i try the script and it works perfect.&lt;/P&gt;&lt;P&gt;Very good job.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you very much.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kind regards&lt;/P&gt;&lt;P&gt;Jacob&lt;/P&gt;</description>
      <pubDate>Mon, 20 May 2019 13:57:40 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-access-control/button-which-clear-a-form-form-field/m-p/3859388#M473020</guid>
      <dc:creator>jacob.parker</dc:creator>
      <dc:date>2019-05-20T13:57:40Z</dc:date>
    </item>
    <item>
      <title>Re: Button which clear a form form field</title>
      <link>https://community.cisco.com/t5/network-access-control/button-which-clear-a-form-form-field/m-p/3859504#M473025</link>
      <description>can you reply with screenshot of what you have, trying to clean and post here: &lt;A href="https://community.cisco.com/t5/security-documents/ise-portals-general-customization-options-global/ta-p/3742904#toc-hId-1883691839" target="_blank"&gt;https://community.cisco.com/t5/security-documents/ise-portals-general-customization-options-global/ta-p/3742904#toc-hId-1883691839&lt;/A&gt;</description>
      <pubDate>Mon, 20 May 2019 16:15:45 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-access-control/button-which-clear-a-form-form-field/m-p/3859504#M473025</guid>
      <dc:creator>Jason Kunst</dc:creator>
      <dc:date>2019-05-20T16:15:45Z</dc:date>
    </item>
    <item>
      <title>Re: Button which clear a form form field</title>
      <link>https://community.cisco.com/t5/network-access-control/button-which-clear-a-form-form-field/m-p/3860165#M473030</link>
      <description>&lt;P&gt;Please find the consolidated script which remove the text entered in the form fields. Please check this and confirm whether it works expected.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&amp;lt;script&amp;gt;

function clearForm(oForm) {&amp;nbsp;&amp;nbsp;

&amp;nbsp;&amp;nbsp;var elements = oForm.elements;

&amp;nbsp; oForm.reset();

}



jQuery('.cisco-ise-form-buttons').append("&amp;lt;div class='ui-submit ui-btn ui-shadow'&amp;gt;&amp;lt;input type='submit' value='Clear Form' class='hotspot-btn'/&amp;gt;&amp;lt;/div&amp;gt;");



jQuery('.hotspot-btn').on('click', function(evt){



clearForm(this.form);

evt.preventDefault();

jQuery("#guestUser\\.fieldValues\\.ui_person_visited").attr("value","servicxxxx@xxxxxx.xxx");



});

&amp;lt;/script&amp;gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 21 May 2019 13:39:17 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-access-control/button-which-clear-a-form-form-field/m-p/3860165#M473030</guid>
      <dc:creator>Jason Kunst</dc:creator>
      <dc:date>2019-05-21T13:39:17Z</dc:date>
    </item>
    <item>
      <title>Re: Button which clear a form form field</title>
      <link>https://community.cisco.com/t5/network-access-control/button-which-clear-a-form-form-field/m-p/3860596#M473033</link>
      <description>&lt;P&gt;it works also fine.....&lt;/P&gt;&lt;P&gt;Perfect!!!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many thanks to hslai and Jason&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kind regards&lt;/P&gt;&lt;P&gt;Jacob&lt;/P&gt;</description>
      <pubDate>Wed, 22 May 2019 03:31:49 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-access-control/button-which-clear-a-form-form-field/m-p/3860596#M473033</guid>
      <dc:creator>jacob.parker</dc:creator>
      <dc:date>2019-05-22T03:31:49Z</dc:date>
    </item>
  </channel>
</rss>

