Sha256: 26388a92dae150168953f8ae892eb796e23d910a5bea036d5de26126de17e27a
Contents?: true
Size: 705 Bytes
Versions: 40
Compression:
Stored size: 705 Bytes
Contents
function scaffold_form_focus() { num_forms = document.forms.length for(i=0;i<num_forms;i++) { elements = document.forms[i].elements num_elements = elements.length for(j=0;j<num_elements;j++) { element = elements[j] tagName = element.tagName if(tagName == 'SELECT' || tagName == 'TEXTAREA' || (tagName == 'INPUT' && (element.type == 'text' || element.type == 'password'))) { if(tagName != 'SELECT') { element.selectionStart = 0 element.selectionEnd = 0 } element.focus() return } } } } scaffold_form_focus()
Version data entries
40 entries across 40 versions & 1 rubygems