947740 Posted November 10, 2008 Share Posted November 10, 2008 This code worked at one point, and now it does not: <script language='javascript' type='text/javascript'> window.start = 4; function addText() { window.start++; var area = document.getElementById("more_fields"); area.innerHTML += "Date: <select name='time[" + window.start + "]'><option value='1225692000' >11/3/2008 <option value='1225778400' >11/4/2008 <option value='1225864800' >11/5/2008 <option value='1225951200' >11/6/2008 <option value='1226037600' >11/7/2008 <option value='1226124000' >11/8/2008 <option value='1226210400' >11/9/2008 <option value='1226296800' selected>11/10/2008 <option value='1226383200' >11/11/2008 <option value='1226469600' >11/12/2008 <option value='1226556000' >11/13/2008 </select> Delete: <input type='checkbox' name='delete[" + window.start + "]' value='delete' /><textarea name='" + start + "' rows='4' class='textarea'></textarea><br /><br />"; } </script> There is a div element called "more_fields" in the html. Help would be appreciated. Link to comment https://forums.phpfreaks.com/topic/132159-solved-content-replacement-innerhtml/ Share on other sites More sharing options...
947740 Posted November 10, 2008 Author Share Posted November 10, 2008 The list of option values being on different lines screwed everything up. Link to comment https://forums.phpfreaks.com/topic/132159-solved-content-replacement-innerhtml/#findComment-686862 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.