gradinumcp
IS-IT--Management
Hey there...I have a perfectly working code where i click a button and the onclick--directs it to a javascript function based on if there is a record in the DB or not. However my boss suggested I not use javascript and do the same with asp....any clues?
<form name="Page1" method="post">
<table>
<tr>
<td>
<% 'Check if record exists in servicing export table
mySQL = "SELECT * FROM ServicingExportFields where loannum='"&rs("Loannum")&"'"
Set RecordCounter = Con.Execute( mySQL )
if RecordCounter.eof<>true then%>
<script language = JavaScript>
function ServiceCheck(tbl, loannum, val)
{
alert("In database")
window.open("Update.asp?tbl="+tbl+"&loannum="+loannum+"&val="+val, target="_main");
}
</script>
<%else%>
<script language = JavaScript>
function ServiceCheck(tbl, loannum, val)
{
alert("Not in Database ")
window.open("Update.asp?tbl="+tbl+"&loannum="+loannum+"&val="+val, target="_main");
}
</script>
<%end if%>
<td <%=BGCOL%>><input type="text" name="WareHouseNumber<%=RS("loannum")%>"><input type="button" Name='Stamp' value='Stamp'onclick="ServiceCheck('DM01', '<%=RS("loannum")%>', document.Page1.WareHouseNumber<%=RS("loannum")%>.value);"></td>
<form name="Page1" method="post">
<table>
<tr>
<td>
<% 'Check if record exists in servicing export table
mySQL = "SELECT * FROM ServicingExportFields where loannum='"&rs("Loannum")&"'"
Set RecordCounter = Con.Execute( mySQL )
if RecordCounter.eof<>true then%>
<script language = JavaScript>
function ServiceCheck(tbl, loannum, val)
{
alert("In database")
window.open("Update.asp?tbl="+tbl+"&loannum="+loannum+"&val="+val, target="_main");
}
</script>
<%else%>
<script language = JavaScript>
function ServiceCheck(tbl, loannum, val)
{
alert("Not in Database ")
window.open("Update.asp?tbl="+tbl+"&loannum="+loannum+"&val="+val, target="_main");
}
</script>
<%end if%>
<td <%=BGCOL%>><input type="text" name="WareHouseNumber<%=RS("loannum")%>"><input type="button" Name='Stamp' value='Stamp'onclick="ServiceCheck('DM01', '<%=RS("loannum")%>', document.Page1.WareHouseNumber<%=RS("loannum")%>.value);"></td>