Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

checkbox

Status
Not open for further replies.

1000kisoen

IS-IT--Management
Aug 12, 2004
37
NL
hi,
I have some problem with my update form particular a checkbox

funtionality is works like this
1> visible/hide some listbox's ( javascript show/ hide)
2> place a text in a textbox (javascript)

so when update a record I stumble with some problems
what's is wrong with this code
error code is complition error "end" statement expected but where...

<input name="Service_Request" type="checkbox"
value="<%=(Update.Fields.Item("Service Request").Value)%>"
<%
if (Update.Fields.Item("Service Request").Value) = -1 then
response.write "Checked"
elseif (Update.Fields.Item("Service Request").Value) = 0 then
response.write ""
End if
%>
<%
if (Update.Fields.Item("Service Request").Value) = -1 then
response.write "show();"
else if (Update.Fields.Item("Service Request").Value) = 0 then
response.write "hide();"
end if
%>>

this is my previous code and it works well ofcourse without update form
<input name="Service_Request" type="checkbox" onClick="show();"
value="<%=(Update.Fields.Item("Service Request").Value)%>"
<%
if (Update.Fields.Item("Service Request").Value) = -1 then
response.write "Checked"
elseif (Update.Fields.Item("Service Request").Value) = 0 then
response.write ""
End if
%>>

please help out with this one
thx kisoen
 
Code:
<input  name="Service_Request" type="checkbox"
value="<%=(Update.Fields.Item("Service Request").Value)%>"
  <%
  if (Update.Fields.Item("Service Request").Value) = -1 then
  response.write "Checked"
  elseif (Update.Fields.Item("Service Request").Value) = 0 then
  response.write ""
  End if
  %>
  <%
  if (Update.Fields.Item("Service Request").Value) = -1 then
  response.write "show();"
  [b]else if[/b] (Update.Fields.Item("Service Request").Value) = 0 then
  response.write "hide();"
  end if
%>>

the bold bit should just be ElseIf by missing out the space you are openng another if statement wich would require a closing "end if"

[Peace][Pipe]
 
hi cheech
i 'am getting
Compilatiefout Microsoft VBScript (0x800A03F6)
end is expecting

please advise
kisoen
 
solved the error by offcours ELSEIF.

but it seams the javacripting is not working

how can that be?
<script language="JavaScript">
<!--
function show() {
var c = document.forms['Incident'].elements['Service_Request'];
changeText(c);
var dS = document.getElementById('the_4');
var dH = document.getElementById('the_2');
dS.style.display = 'inline';
dH.style.display = 'none';
c.onclick = hide;
}

function hide() {
var c = document.forms['Incident'].elements['Service_Request'];
changeText(c);
var dS = document.getElementById('the_4');
var dH = document.getElementById('the_2');
dS.style.display = 'none';
dH.style.display = 'inline';
c.onclick = show;
}
-->
</script>
please advise
kisoen
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top