hey...I need urgent help I have 2 comboboxes on a form and when I post the results back to the page 1 comboboxes continues to show but I need it hidden..

here's the code:

<td><strong>or Owner</strong> 			
<td><SELECT id="cboGpOwner" style="WIDTH: 96px;" name="cboGpOwner">
<OPTION value=0 selected> </OPTION>
<OPTION value=1>AI</OPTION> 

			                    <td align="middle"><input style="FONT-WEIGHT: bolder; WIDTH: 78px; COLOR: white; HEIGHT: 24px; BACKGROUND-COLOR: #7e7ec9" type="submit" value="Submit" name="btnSubmit"  id ="btnSubmit"  onmouseover ="this.style.backgroundColor = '#be6572'" onmouseout="this.style.backgroundColor = '#7e7ec9'" size=16></td>
								<td align="middle"><input style="FONT-WEIGHT: bolder; WIDTH: 73px; COLOR: white; HEIGHT: 24px; BACKGROUND-COLOR: #7e7ec9" type="submit" value="Clear" name="btnClear"  id ="btnClear"  onmouseover="this.style.backgroundColor = '#be6572'" onmouseout="this.style.backgroundColor = '#7e7ec9'" size=12></td>
								<td align="middle width=0" height="0">
								<input id="Text1" NAME="txtClicked" MAXLENGTH="6" style="WIDTH: 0px; COLOR: #000000; HEIGHT: 0px; BACKGROUND-COLOR: #c9c9c9; TEXT-ALIGN: left" readonly></td>

the other box shows when the page is updatable = true

<script LANGUAGE="vbscript" RUNAT="Server">
	Function showComboBox(secId, selected)
	Dim s
	s =  "<select name=""cboGPOwner2"" style=""width:90px"" Onchange=""alert('Please Enter changes by clicking on Save')"">"
	if trim(selected) = "AI" Then
	s =  s +"<option value=""" & secId &  ";AI"" selected>AI</option>"
	s =  s +"<option value=""" & secId &  ";AI"">AI</option>"
	end if 
	if trim(selected) = "PAL" Then
	s = s + "<option value=""" & secId &  ";PAL"" selected>PAL</option>"
	s = s + "<option value=""" & secId &  ";PAL"">PAL</option>"
	End if 		
	s = s + "<option value=""" & secId &  ";UNKNOWN"">UNKNOWN</option>"
		End if 	
		s = s + "</select>"
		showComboBox = s
	End Function

my code to disable the 1st combobox =

<script language="javascript">

								function NoShowOwner()
								if updatable = true then
								else if updatable = false then

I'm trying to figure out when to call it? can anyone help

Call it when you can successfully request.form.

And also, make sure that you are always leaving a value. Like the If Updatable = true then .... ELSE .... end if

By using an if .. else if.. end if statement, you are not leaving a default action. Basically, you want to see if it is checked. If it is, then disable, if not, enable.

Just try something like this:

Function NoShowOwner()
  If request.form("cboGpOwner") <> "0" Then
    'disable it
    'enable it, incase it was disabled.
  End If
End Function
This article has been dead for over six months. Start a new discussion instead.