Javascript/ASP project

Status
Not open for further replies.

J^M

Ars Scholae Palatinae
815
Subscriptor++
I've semi-inherited a document tracking system with a database back end and web-based front end. Currently, it doesn't let users enter the kind of granular, reportable information that is desired. I haven't had any trouble adding a new table to the DB, but due to my lack of experience with JS/ASP, I'm struggling a little with the interface.

Users need to be able to add an arbitrary amount of documents per group... 0, 1, maybe up to 20, from a list of 50 or more. I've come up with something that presents a form the users should like, but there are some problems. I'm guessing this will look like an ugly hack to experienced programmers...
Code:
<script type="text/javascript">
function ins_row() 
{
var x=document.getElementById('doc_errs').insertRow(0);
var y=x.insertCell(0);
y.innerHTML="<div class=\"docbox\"><form><select name=\"DocName\"><option value=\"\">Select a Document</option><option value=\"opt1\">opt1</option><option value=\"opt2\">opt2</option><input type=\"radio\" name=\"DocError\" value=\"ok\"/>ok<input type=\"radio\" name=\"DocError\" value=\"not ok\"/>not ok<textarea name=\"DocComment\" rows=\"3\" cols=\"50\">Comment</textarea></form></div>";
}
</script>

<button type="button" onclick="ins_row()">Add New Document</button>

<table id="doc_errs"></table>

item 1: Updating the document names in that menu is going to be a pain in the ass. Is there a better way, like pulling them from an xml file?

item 2: Is there a better way, period?

item 3: I haven't gotten to the code for this yet, but whatever the users enters in each form needs to become a new record in the DB. A shot in the dark here: loop through the table and add the values to the SQL string sent to the server?
 
Status
Not open for further replies.