M
Marc Twain
I'm have implemented half of a form that the user can expend by
clicking on a 'plus' signs next to some of the fields. For example, if
there is a 'language' option, the user can click the plus sign until
he has enough boxes to enter the 5 languages he or she speaks.
I was successful in implementing this on IE, unfortunately that code
is not cross-browser compatible. I'd like it to be supported by IE4
and NS4 +. Right now it would only work on IE. ( I guess my problem is
this 'innerHTML' property.)
function addItem(element) {
if (element.id == 'areasOfExpertise' && areasOfExpertiseCount == 6) {
alert("No more than 5 Areas of Expertise can be submitted");
} else {
if (eval(element.id + 'Count') <= 20) {
element.innerHTML = element.innerHTML + '<br><br>' +
varGenerator(element.id);
} else {
alert('Sorry, no more fields available.');
}
}
}
function varGenerator(elementID) {
if (elementID == 'languages') {
contentVar = '<select name="languageID' + languagesCount +
'"><option value="">None Selected</option><cfoutput
query="getDropDownLanguages"><option
value="#ID#">#name#</option></cfoutput></select>';
languagesCount++;
}
else if ... <SNIP>
return contentVar;
}
Any suggestion would be great!
TIA,
Marc.
clicking on a 'plus' signs next to some of the fields. For example, if
there is a 'language' option, the user can click the plus sign until
he has enough boxes to enter the 5 languages he or she speaks.
I was successful in implementing this on IE, unfortunately that code
is not cross-browser compatible. I'd like it to be supported by IE4
and NS4 +. Right now it would only work on IE. ( I guess my problem is
this 'innerHTML' property.)
function addItem(element) {
if (element.id == 'areasOfExpertise' && areasOfExpertiseCount == 6) {
alert("No more than 5 Areas of Expertise can be submitted");
} else {
if (eval(element.id + 'Count') <= 20) {
element.innerHTML = element.innerHTML + '<br><br>' +
varGenerator(element.id);
} else {
alert('Sorry, no more fields available.');
}
}
}
function varGenerator(elementID) {
if (elementID == 'languages') {
contentVar = '<select name="languageID' + languagesCount +
'"><option value="">None Selected</option><cfoutput
query="getDropDownLanguages"><option
value="#ID#">#name#</option></cfoutput></select>';
languagesCount++;
}
else if ... <SNIP>
return contentVar;
}
Any suggestion would be great!
TIA,
Marc.