Forums

This topic is locked

Javascript function

Posted 31 Mar 2004 16:18:59
1
has voted
31 Mar 2004 16:18:59 Josh jbarton posted:
I have a form that i am currently doing batch updates. The problem i have is -
If a user clicks a checkbox, i need a hidden object to receive 1, if they uncheck it, the the hidden object recieves 0. Here is what i have,
<script language="JavaScript" type="text/JavaScript">

function checked()
{
if (document.form1.RFr_Selected<%=(rs.Fields.Item("Entry_Id".Value)%>.checked == true)
document.form1.RFr_Printed<%=(rs.Fields.Item("Entry_Id".Value)%>.value = 1;
else
document.form1.RFr_Printed<%=(rs.Fields.Item("Entry_Id".Value)%>.value = 0;
}
</script>

Can anyone help? Thanks in advance!

Replies

Replied 31 Mar 2004 16:22:36
31 Mar 2004 16:22:36 Josh jbarton replied:
Just to add on a bit, this script works, but only for the first record.
Replied 02 Apr 2004 13:37:33
02 Apr 2004 13:37:33 Marja Ribbers-de Vroed replied:
Your clientside JavaScript function is probably defined in the HEAD section of the page and this gets loaded only once substituting the serverside values with the the database values for the first record in your recordset.

These values will never change in that function, because the function does not get rewritten/reloaded in your repeat region. The function is static once the page is loaded.

If you check the source of the page once it is loaded in your browser, you can clearly see this.

Hope this helps.

--
Marja Ribbers-de Vroed
www.flevooware.nl
www.flevooware.nl/dreamweaver/


Edited by - MarjaR on 02 Apr 2004 13:37:57

Edited by - MarjaR on 02 Apr 2004 13:38:27

Reply to this topic