pixrite
04-13-2005, 10:16 PM
I have a table with records in it that have an active/innactive status selector. The selector is a checkbox and all of them are within a form. What I want to have happen is for users to be able to click the checkbox right within the webpage and then depending on the value of that checkbox that is clicked, update the value within the database.
This is what I have - please excuse my lack of knowledge on this stuff - I'm usually working with ASP and SQL - not Javascript and DOM...
------------------------------------------------
function Activate(CurrentBox, Idea) {
if{frmIdeaAdmin.cbActive(CurrentBox).Checked){
alert("Activating Record " + Idea);
}
if{!frmIdeaAdmin.cbActive(CurrentBox).Checked){
alert("De-Activating Record " + Idea);
}
}
------------------------------------------------
<input name="cbActive<%=iLoopCounter%>" type="checkbox" onClick="Activate(<%=iLoopCounter%>,<%=strProjectID%>)" value="checkbox" <%if bProjectActive = "T" then%>checked<%end if%>>
------------------------------------------------
The "frmIdeaAdmin.cbActive(CurrentBox).Checked" line above is having problems and I'm also at a loss for how to right the new value to the database. I can probably figure out the database part - but the JavaScript and DOM issues are killing me.
Any help would be totally cool!
Thanks!
This is what I have - please excuse my lack of knowledge on this stuff - I'm usually working with ASP and SQL - not Javascript and DOM...
------------------------------------------------
function Activate(CurrentBox, Idea) {
if{frmIdeaAdmin.cbActive(CurrentBox).Checked){
alert("Activating Record " + Idea);
}
if{!frmIdeaAdmin.cbActive(CurrentBox).Checked){
alert("De-Activating Record " + Idea);
}
}
------------------------------------------------
<input name="cbActive<%=iLoopCounter%>" type="checkbox" onClick="Activate(<%=iLoopCounter%>,<%=strProjectID%>)" value="checkbox" <%if bProjectActive = "T" then%>checked<%end if%>>
------------------------------------------------
The "frmIdeaAdmin.cbActive(CurrentBox).Checked" line above is having problems and I'm also at a loss for how to right the new value to the database. I can probably figure out the database part - but the JavaScript and DOM issues are killing me.
Any help would be totally cool!
Thanks!