Code Stopped Working after Adding two Radio Buttons
This webpage is for an intranet ticketing system. My company is implementing Kaizen so we need to keep track of Kaizen tickets. In order to do this I added two radio buttons: one for yes and one for no. I also made it a requirement for one of the radio buttons be selected prior to sending in the request. The problem that I am having is that since the additional features were added none of the buttons are working as well as the "name" drop down menu no longer populates. I tried using the current working page and just entering the additional parts, but nothing still seems to work. Could someone please take a look at it and let me know they see something wrong. I'm using HTML-Kit and it's not giving me any errors. I'm lost. Thanks. I have attached the entire page so that you can see what all is going on. The MAIN problems are getting the autopopulation to work again when someone selects a name as well as getting the buttons to work. Which as I said died when I added the two items below. Thanks again.
HTML Code:
'Lines 173-176
'ADDED****************************************
[B]if document.HelpTicket.EmployeeCIP(0).checked=false and document.HelpTicket.EmployeeCIP(1).checked=false then
valid=false
message = message & "Employee CIP" & vbCrLf
end if[/B]
'*********************************************
'Lines 643-651
'ADDED**************************************************
[B]<tr><td colspan="5"><font SIZE="1">Is this a Kaizen Plus Employee CIP request?</font><br/><input type="radio" id="EmployeeCIP" name="EmployeeCIP" value="Yes" <%if Request.Form("EmployeeCIP")="Yes" then Response.Write " CHECKED"%>>
<font size="1">Yes</font><input type="radio" id="EmployeeCIP" name="EmployeeCIP" value="No" <%if Request.Form("EmployeeCIP")="No" then Response.Write " CHECKED"%>>
<font size="1">No</font></td></tr>[/B]
'*******************************************************
Nenio foriras ĝis ĝi havas instru ni kiu ni devas scii.
Re: Code Stopped Working after Adding two Radio Buttons
ManOfSteel,
I've had a look through your code and I can't see anything obvious. The thing to do if you've not already done so is to comment out your changes and see if your page starts working again. If it doesn't then you know it's something else that's causing the problem.
I don't normally use vbscript on the client side so not sure if the code you're using to access the radiobuttonlist is correct or not, maybe put an onclick event in for the radiobuttonlist and return a msgbox with the value or the checked status.
Next I don't see why you need to kill your connection for each recordset, I would suggest that you create the connection at the top of the page then reuse it for each recordset you require, then close each recordset when you've finished with it. Then at the bottom of the page close the connection
Finally I can't see any error handling, but just to be sure at the top of your page it might be worth putting in an "On Error GoTo 0"
Last edited by aconybeare; Mar 11th, 2007 at 05:20 PM.
Re: Code Stopped Working after Adding two Radio Buttons
I also don't know if it is a good idea to put if else code within a controls html blocks <>
Code:
<input type="radio" id="EmployeeCIP" name="EmployeeCIP" value="Yes" <%if Request.Form("EmployeeCIP")="Yes" then Response.Write " CHECKED"%>><font size="1">Yes</font>
I would do this instead
dim myYesResult
if Request.Form("EmployeeCIP")="Yes" then
myYesResult=" CHECKED"
else
myYesResult=""
end if
<input type="radio" id="EmployeeCIP" name="EmployeeCIP" value="Yes" <%=myYesResult%>><font size="1">Yes</font>
my two cents worth.....
Last edited by gtilles; Mar 12th, 2007 at 12:17 PM.