![]() |
|
|
| Subject:
VBScript/Javascript Programming
Category: Computers > Programming Asked by: callawar-ga List Price: $30.00 |
Posted:
13 Sep 2005 05:44 PDT
Expires: 13 Oct 2005 05:44 PDT Question ID: 567506 |
I am looking for a vbscript or javascript for a "submit" button that updates an Access database with either the word "Approved" or "Disapproved" in the "Status" column which is created in the Access database. I would prefer separate buttons, one for "Approved" and another for "Disapproved." If "Approved" is selected, the words "Approved" should be green while the "Disapproved" selection should be red. |
|
| There is no answer at this time. |
|
| Subject:
Re: VBScript/Javascript Programming
From: pmmbala1976-ga on 13 Sep 2005 11:20 PDT |
save the below code as test.asp and change the table name and also add
the where condition to sql query. it will update the status column to
access db.
and uncomment the connection string code.
thanks
bala
code:
<%@ Language=VBScript %>
<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
</HEAD>
<script language=javascript>
function approve()
{
alert("ss");
document.form1.txtapp.value ='1';
document.form1.txtdisapp.value ='1';
}
function Disapprove()
{
document.form1.txtapp.value ='0';
document.form1.txtdisapp.value ='1';
}
</script>
<BODY>
<form name=form1 method=post action="test.asp" >
<P>
<INPUT type=hidden name="txtapp" >
<INPUT type=hidden name="txtdisapp" > </P>
<P> </P>
<P><INPUT id=submit1 type=submit value=Approved name=submit1
onclick="javascript:approve()">
<INPUT id=submit2 type=submit value=Disapproved name=submit2
onclick="javascript:Disapprove()" ></P>
</form>
</BODY>
</HTML>
<%
'**************************************************************
'|||||||||||| Connection opened for MS Access |||||||||||||||
'**************************************************************
'Set objConn = Server.CreateObject("ADODB.Connection")
'objConn.ConnectionString = "Provider="& strAccessProvider &";Data
Source=" & Server.MapPath(strAccessDataBase)
'objConn.Open
dim sql
if Request.Form("txtapp") = 1 then
Response.Write "approve clicked"
sql ="Update tablename set Status='Approved'"
' and also you must include where any condition
elseif Request.Form("txtdisapp") = 1 then
Response.Write "dis approve clicked"
sql ="Update tablename set Status='DISApproved'"
' and also you must include where any condition
end if
Response.End
%> |
| Subject:
Re: VBScript/Javascript Programming
From: callawar-ga on 16 Sep 2005 07:59 PDT |
Thanks for your help. |
If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you. |
| Search Google Answers for |
| Google Home - Answers FAQ - Terms of Service - Privacy Policy |