Topic: Changing a hidden inputs value does not work in IE?!?

<script>
// code which gets parent_id by ajax is here...
document.getElementById("site_id").value = parent_id;
alert(parent_id);
</script>

<input type="text" id ="site_id" name="report[site_id]" value="<%= @report.site_id.to_s if @report.has_site? %>" />


I made the input of type text so I can see whats going on... The alert shows parent_id contains a number but the input is never set! This works in Firefox just fine. The client is using IE 6.

Any ideas, it looks so stright forward I cant see any problems...


Many thanks in advance, AFM.

Re: Changing a hidden inputs value does not work in IE?!?

Worked it out, I had other inputs with the name "site_id" which where selects, once I removed the name attribute from these it worked!! So basically it seems IE's javascript engine treats ID and name attributes the same.

Last edited by afm (2007-07-24 10:08:00)