Cross-browser compatible dynamic form: possible?

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,525
Members
44,997
Latest member
mileyka

Latest Threads

Top