| Line 873... |
Line 873... |
| 873 |
var fieldHtml = '',//variable contenant tout le html à afficher
|
873 |
var fieldHtml = '',//variable contenant tout le html à afficher
|
| 874 |
commonFieldsHtml = {},//Éléments simples ou chaînes communes aux "listes"
|
874 |
commonFieldsHtml = {},//Éléments simples ou chaînes communes aux "listes"
|
| 875 |
listFieldsHtml = {},//chaînes & html pour les listes mais non spécifiques
|
875 |
listFieldsHtml = {},//chaînes & html pour les listes mais non spécifiques
|
| 876 |
listFieldsHtml = {},//chaînes & html spécifiques aux listes
|
876 |
listFieldsHtml = {},//chaînes & html spécifiques aux listes
|
| 877 |
count = fieldOptions.length;//nombre d'options, pour les boucles for
|
877 |
count = fieldOptions.length;//nombre d'options, pour les boucles for
|
| 878 |
fieldLabel = fieldLabel.replace( /(')/gm, '''' ).replace( /(")/gm, '""' );
|
878 |
fieldLabel = fieldLabel.replace( /(')/gm, ''' ).replace( /(")/gm, '"' );
|
| 879 |
fieldTooltip = fieldTooltip.replace( /(')/gm, '''' ).replace( /(")/gm, '""' );
|
879 |
fieldTooltip = fieldTooltip.replace( /(')/gm, ''' ).replace( /(")/gm, '"' );
|
| 880 |
fieldPlaceholder = fieldPlaceholder.replace( /(')/gm, '''' ).replace( /(")/gm, '""' );
|
880 |
fieldPlaceholder = fieldPlaceholder.replace( /(')/gm, ''' ).replace( /(")/gm, '"' );
|
| Line 881... |
Line 881... |
| 881 |
|
881 |
|
| 882 |
//valeurs initiales des chaînes de caractères
|
882 |
//valeurs initiales des chaînes de caractères
|
| 883 |
//Éléments simples ou chaînes communes aux "listes"
|
883 |
//Éléments simples ou chaînes communes aux "listes"
|
| 884 |
commonFieldsHtml = {
|
884 |
commonFieldsHtml = {
|
| Line 1000... |
Line 1000... |
| 1000 |
// value-id
|
1000 |
// value-id
|
| 1001 |
listFieldsHtml.optionIdAttr +
|
1001 |
listFieldsHtml.optionIdAttr +
|
| 1002 |
// Name
|
1002 |
// Name
|
| 1003 |
commonFieldsHtml.fieldInput.nameAttr +
|
1003 |
commonFieldsHtml.fieldInput.nameAttr +
|
| 1004 |
// Value
|
1004 |
// Value
|
| 1005 |
' value="' + fieldOption.optionValue.replace( /(')/gm, '''' ).replace( /(")/gm, '""' ) + '"' +
|
1005 |
' value="' + fieldOption.optionValue.replace( /(')/gm, ''' ).replace( /(")/gm, '"' ) + '"' +
|
| 1006 |
// Checked
|
1006 |
// Checked
|
| 1007 |
listFieldsHtml.defaultAttr +
|
1007 |
listFieldsHtml.defaultAttr +
|
| 1008 |
// Class="nom du champ"
|
1008 |
// Class="nom du champ"
|
| 1009 |
commonFieldsHtml.fieldInput.classAttr +
|
1009 |
commonFieldsHtml.fieldInput.classAttr +
|
| 1010 |
'>' +
|
1010 |
'>' +
|
| 1011 |
// Label de l'option
|
1011 |
// Label de l'option
|
| 1012 |
fieldOption.optionText.replace( /(')/gm, '''' ).replace( /(")/gm, '""' ) +
|
1012 |
fieldOption.optionText.replace( /(')/gm, ''' ).replace( /(")/gm, '"' ) +
|
| 1013 |
'</label>';
|
1013 |
'</label>';
|
| 1014 |
}
|
1014 |
}
|
| 1015 |
// Si valeur "autre" est cochée
|
1015 |
// Si valeur "autre" est cochée
|
| 1016 |
if( fieldOtherValue ) {
|
1016 |
if( fieldOtherValue ) {
|
| 1017 |
fieldHtml +=
|
1017 |
fieldHtml +=
|
| Line 1075... |
Line 1075... |
| 1075 |
for( let i = 0; i < count; i++ ) {
|
1075 |
for( let i = 0; i < count; i++ ) {
|
| 1076 |
let fieldOption = fieldOptions[i];
|
1076 |
let fieldOption = fieldOptions[i];
|
| 1077 |
// Type="checkbox"
|
1077 |
// Type="checkbox"
|
| 1078 |
commonFieldsHtml.fieldInput.typeAttr = ' type="checkbox"';
|
1078 |
commonFieldsHtml.fieldInput.typeAttr = ' type="checkbox"';
|
| 1079 |
// Id
|
1079 |
// Id
|
| 1080 |
listFieldsHtml.inputIdAttr = ' id="' + fieldOption.optionValue.replace( /(')/gm, '''' ).replace( /(")/gm, '""' ).toLowerCase() + '"';
|
1080 |
listFieldsHtml.inputIdAttr = ' id="' + fieldOption.optionValue.replace( /(')/gm, ''' ).replace( /(")/gm, '"' ).toLowerCase() + '"';
|
| 1081 |
// For
|
1081 |
// For
|
| 1082 |
listFieldsHtml.forAttr = ' for="' + fieldOption.optionValue.replace( /(')/gm, '''' ).replace( /(")/gm, '""' ).toLowerCase() + '"';
|
1082 |
listFieldsHtml.forAttr = ' for="' + fieldOption.optionValue.replace( /(')/gm, ''' ).replace( /(")/gm, '"' ).toLowerCase() + '"';
|
| 1083 |
// Default
|
1083 |
// Default
|
| 1084 |
listFieldsHtml.defaultAttr = '';//réinitialisation
|
1084 |
listFieldsHtml.defaultAttr = '';//réinitialisation
|
| 1085 |
if( fieldOption.isDefault ) {
|
1085 |
if( fieldOption.isDefault ) {
|
| 1086 |
listFieldsHtml.defaultAttr = ' checked';//affectation
|
1086 |
listFieldsHtml.defaultAttr = ' checked';//affectation
|
| 1087 |
}
|
1087 |
}
|
| Line 1105... |
Line 1105... |
| 1105 |
// value-id
|
1105 |
// value-id
|
| 1106 |
listFieldsHtml.optionIdAttr +
|
1106 |
listFieldsHtml.optionIdAttr +
|
| 1107 |
// Name
|
1107 |
// Name
|
| 1108 |
commonFieldsHtml.fieldInput.nameAttr +
|
1108 |
commonFieldsHtml.fieldInput.nameAttr +
|
| 1109 |
// Value
|
1109 |
// Value
|
| 1110 |
' value="' + fieldOption.optionValue.replace( /(')/gm, '''' ).replace( /(")/gm, '""' ) + '"' +
|
1110 |
' value="' + fieldOption.optionValue.replace( /(')/gm, ''' ).replace( /(")/gm, '"' ) + '"' +
|
| 1111 |
// Checked
|
1111 |
// Checked
|
| 1112 |
listFieldsHtml.defaultAttr +
|
1112 |
listFieldsHtml.defaultAttr +
|
| 1113 |
// Class="nom du champ"
|
1113 |
// Class="nom du champ"
|
| 1114 |
commonFieldsHtml.fieldInput.classAttr +
|
1114 |
commonFieldsHtml.fieldInput.classAttr +
|
| 1115 |
// DataId
|
1115 |
// DataId
|
| 1116 |
commonFieldsHtml.dataIdAttr +
|
1116 |
commonFieldsHtml.dataIdAttr +
|
| 1117 |
'>' +
|
1117 |
'>' +
|
| 1118 |
// Label de l'option
|
1118 |
// Label de l'option
|
| 1119 |
fieldOption.optionText.replace( /(')/gm, '''' ).replace( /(")/gm, '""' ) +
|
1119 |
fieldOption.optionText.replace( /(')/gm, ''' ).replace( /(")/gm, '"' ) +
|
| 1120 |
'</label>';
|
1120 |
'</label>';
|
| 1121 |
}
|
1121 |
}
|
| 1122 |
// Si valeur "autre" est cochée
|
1122 |
// Si valeur "autre" est cochée
|
| 1123 |
if( fieldOtherValue ) {
|
1123 |
if( fieldOtherValue ) {
|
| 1124 |
fieldHtml +=
|
1124 |
fieldHtml +=
|
| Line 1188... |
Line 1188... |
| 1188 |
}
|
1188 |
}
|
| Line 1189... |
Line 1189... |
| 1189 |
|
1189 |
|
| 1190 |
fieldHtml +=
|
1190 |
fieldHtml +=
|
| 1191 |
'<option' +
|
1191 |
'<option' +
|
| 1192 |
// Value
|
1192 |
// Value
|
| 1193 |
' value="' + fieldOption.optionValue.replace( /(')/gm, '''' ).replace( /(")/gm, '""' ) + '"' +
|
1193 |
' value="' + fieldOption.optionValue.replace( /(')/gm, ''' ).replace( /(")/gm, '"' ) + '"' +
|
| 1194 |
// Value-id
|
1194 |
// Value-id
|
| 1195 |
listFieldsHtml.optionIdAttr +
|
1195 |
listFieldsHtml.optionIdAttr +
|
| 1196 |
// Selected
|
1196 |
// Selected
|
| 1197 |
listFieldsHtml.defaultAttr +
|
1197 |
listFieldsHtml.defaultAttr +
|
| 1198 |
'>' +
|
1198 |
'>' +
|
| 1199 |
// Option
|
1199 |
// Option
|
| 1200 |
fieldOption.optionText.replace( /(')/gm, '''' ).replace( /(")/gm, '""' ) +
|
1200 |
fieldOption.optionText.replace( /(')/gm, ''' ).replace( /(")/gm, '"' ) +
|
| 1201 |
'</option>';
|
1201 |
'</option>';
|
| 1202 |
}
|
1202 |
}
|
| 1203 |
// Si valeur "autre" est cochée
|
1203 |
// Si valeur "autre" est cochée
|
| 1204 |
if( fieldOtherValue ) {
|
1204 |
if( fieldOtherValue ) {
|