PHP Classes

File: fwphp/glomodul/z_examples/AJAX_form_valid/clear_form/demo1.js

Recommend this page to a friend!
  Classes of Slavko Srakocic   B12 PHP FW   fwphp/glomodul/z_examples/AJAX_form_valid/clear_form/demo1.js   Download  
File: fwphp/glomodul/z_examples/AJAX_form_valid/clear_form/demo1.js
Role: Auxiliary data
Content type: text/plain
Description: Auxiliary data
Class: B12 PHP FW
Manage database records with a PDO CRUD interface
Author: By
Last change: Update of fwphp/glomodul/z_examples/AJAX_form_valid/clear_form/demo1.js
Date: 1 year ago
Size: 591 bytes
 

Contents

Class file image Download
function clearForm(oForm) { var elements = oForm.elements; oForm.reset(); for(i=0; i<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; } } }