I have an ASP form that end-users will be useing to update a SQL 2000 database. It is an upgrade to an MS-Access dtabase frontednd that I built using VBA.
The problem I have is that I need to get users to fill out specific data elements based on values within other data elements. For example if an end-user chooses a 'CAR' action then I need a pop-up window to appear with additional fields that required entry. If the user chooses 'QA Audit' I do not need the pop-up window to appear.
In other words I need to get similar functionality that I had with an onUpdate event where If a field equals a certain value another fileds visiblity is set to True else it was False.
I already have the javascript for the pop-up window included and I call it from the onChange attribute of the <Select> tag. I just need to figure out how to conditionalize the pop-up box based on the value chosen? and How do I pass the value into the function?
Here is the Code for the Script and the Select Opject.
The problem I have is that I need to get users to fill out specific data elements based on values within other data elements. For example if an end-user chooses a 'CAR' action then I need a pop-up window to appear with additional fields that required entry. If the user chooses 'QA Audit' I do not need the pop-up window to appear.
In other words I need to get similar functionality that I had with an onUpdate event where If a field equals a certain value another fileds visiblity is set to True else it was False.
I already have the javascript for the pop-up window included and I call it from the onChange attribute of the <Select> tag. I just need to figure out how to conditionalize the pop-up box based on the value chosen? and How do I pass the value into the function?
Here is the Code for the Script and the Select Opject.
Code:
<script language="JavaScript">
Function goNewWin() {
var NewWinHeight=200;
var NewWinWidth=500;
var NewWinPutX=20;
var NewWinPutY=20;
TheNewWin TheNewWin =window.open("Attribute.htm",'TheNewpop','fullscreen=no,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no'
TheNewWin.resizeTo(NewWinHeight,NewWinWidth);
TheNewWin.moveTo(NewWinPutX,NewWinPutY);
}
</script>
Code:
<!-----ASP Code-->
<TABLE cellspacing="1" width="100%" style="BORDER-RIGHT: blue 4px groove; BORDER-TOP: blue 2px groove; FONT-WEIGHT: normal; FONT-SIZE: 10px; BORDER-LEFT: blue 2px groove; COLOR: blue; BORDER-BOTTOM: blue 4px groove; BACKGROUND-COLOR: #cccccc" ID="Table9">
<tr>
<td width="35%">
<% 'FlagType
FlagType=Request.Form("FlagType")
If Err.number <> 0 Then
Response.Write "<br>ASP Err.Number: "& Err.Number &"<br>"
Else SQLStr="SELECT * FROM dbo.tblComFlag order by FlagType"
Set RS1 = dbConn.Execute(SQLStr)
Response.Write "Commitment Type: "&"<SELECT NAME=""FlagType"" onChange=""goNewWin(FlagType)"" Size=1>"
Response.Write "<option></option>"
WHILE NOT RS1.EOF
RESPONSE.Write"<option value='"&RS1("FlagType")&"'>" & RS1("FlagType")
RS1.MoveNext WEND Response.Write "</SELECT>"
End if
%>
</td>
</tr>
</TABLE>