- Code: Select all
function addElement(){
var count = document.getElementById("count").value;
++count;
var AdEl = document.createElement('div');
AdEl.innerHTML = "<input type='text' name='ident" + count + "' value='"+count+"' /><br /><textarea name='style" + count + "' cols='60' rows='5'></textarea><hr>";
document.getElementById('adds').appendChild(AdEl);
document.getElementById("count").value = count;
}
and my form field is
- Code: Select all
<input type='hidden' name='count' value='7' id='count'>
if i set the variable manually it works fine but it just wont get the value out of the form field.
any help would be appreciated, cheers!
**** UPDATE ****
if i return the value of count right after i grab it from the hidden field i get 'undefined'

