I'm trying to make a page that lists records, and allows to show a form to edit a value. It reloads the page with "?edit=true" added to the end so it knows to pull the data into a form, rather than list all entries. I did this after loading it in an iframe to replace the body wasn't working. And I have managed to do this in a different form exactly the same way - except it worked. (Actually, I have two functions that show a form, and only 1 will show up)
The output I get instead of the form is
; }catch(e) { alert(e); }
This is at the bottom to be loaded last:
<script type="text/javascript">
try {
document.getElementById("viewb").style.display = "none";
document.getElementById("reviewb").style.display = "none";
document.getElementById("editb").style.display = "none";
document.getElementById("reeditb").style.display = "none";
document.getElementById("delb").style.display = "none";
document.getElementById("panel").innerHTML = "<%call showAScreen()%>";
}catch(e) {
alert(e);
}
</script>
This is the first defined asp function - placed after the JavaScript functions at the top:
<% sub showAScreen()
If Request.QueryString("edit") <> "" Then
showedits()
else
showControlScreen()
end if
end sub %>
This is the rest:
<% sub showedits() 'Show edit record form
dim selsql
selsql = ""
selsql = selsql & "SELECT A.[NBK] as 'NBK ID'"
selsql = selsql & " ,A.[PersonNumber] as 'Person Number'"
...
selsql = selsql & " ,A.[AOIScore] as 'AOI Score'"
selsql = selsql & " ,A.[VendorName] as 'Vendor Name'"
selsql = selsql & " FROM (([ReportingDevDB].[dbo].[bAssociateRoster] as A left join "
selsql = selsql & "[ReportingDevDB].[dbo].[bAssociateRoster] as B on A.ManagerNBK = B.NBK) left join"
selsql = selsql & "[ReportingDevDB].[dbo].[bAssociateRoster] as C on A.TeamLeadNBK = C.NBK)"
selsql = selsql & " where A.NBK='" & Request.QueryString("edit") & "'"
on error resume next
set rs = cnt.execute(selsql)
dim outstr
outstr = "<table><tr><td id='content'>"'Frame for code to be pulled from.
outstr = outstr & "<form id='form' method='post' action='NewRosterManager.asp?selectnbk=" & rs(0) & "&update=true'>"
outstr = outstr & "<table class='bluetable'>"
outstr = outstr & "<thead><tr><td colspan='32'>Edit Data</td></tr></thead>"
outstr = outstr & "<tbody class='list' style='text-align:left'>"
outstr = outstr & "<tr><td>NBK:</td><td id='RecordNBK'>" & rs(0) & "</td></tr>"
...
outstr = outstr & "<tr><td>Vendor Name:</td><td><input type='text' id='e_VendorName' name='e_VendorName' value='" & rs(25) & "'></td></tr>"
outstr = outstr & "</tbody></table><input type='submit'></form>"
outstr = outstr & "</td></tr></table>"'Frame for code to be pulled from.
Response.write "<br/>" & outstr & "<br/>"
Response.write selsql 'this doesn't work... can't test query
end sub %>
Again... I have tried everything I can think of over the past week, and I cannot find anything remotely like this in my google searches. I cannot even get the query to print.