1/*************************************************************** 2* 3* Universal formupdate-function 4* 5* Copyright notice 6* 7* (c) 1998-2003 Kasper Skaarhoj 8* (c) 2005-2007 Stanislas Rolland 9* All rights reserved 10* 11* This script is part of the TYPO3 t3lib/ library provided by 12* Kasper Skaarhoj <[email protected]> together with TYPO3 13* 14* This modified script is part of the TYPO3 sr_feuser_register extension provided by 15* Stanislas Rolland <[email protected]> to use form id rather than formname 16* 17* Released under GNU/GPL (see license file in tslib/) 18* 19* This script is distributed in the hope that it will be useful, 20* but WITHOUT ANY WARRANTY; without even the implied warranty of 21* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 22* 23* This copyright notice MUST APPEAR in all copies of this script 24***************************************************************/ 25 26 27function updateForm(formId,fieldname,value) { 28 function htmlSpecialChars_decode (str) { 29 return str.replace(/</g, '<') 30 .replace(/>/g, '>') 31 .replace(/&/g, '&') 32 .replace(/"/g, '"'); 33 } 34 35 var formObj = document.getElementById(formId); 36 if (formObj && formObj[fieldname]) { 37 var fObj = formObj[fieldname]; 38 var type=fObj.type; 39 if (!fObj.type) { 40 type="text"; 41 } 42 switch(type) { 43 case "password": 44 fObj.value = value; 45 break; 46 case "checkbox": 47 fObj.checked = ((value && value!=0) ? "on":""); 48 break; 49 case "select-one": 50 var l=fObj.length; 51 for (a=0;a<l;a++) { 52 if (fObj.options[a].value == value) { 53 fObj.selectedIndex = a; 54 } 55 } 56 break; 57 case "select-multiple": 58 var l=fObj.length; 59 for (a=0;a<l;a++) { 60 if (fObj.options[a].value == value) { 61 fObj.options[a].selected = 1; 62 } 63 } 64 break; 65 case "radio": 66 var l=fObj.length; 67 for (a=0; a<l;a++) { 68 if (fObj[a].value==value) { 69 fObj[a].checked = 1; 70 } 71 } 72 break; 73 default: 74 fObj.value = htmlSpecialChars_decode(value); 75 } 76 } 77}
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.