This topic is locked

Selectedindex - update DB

10/2/2008 8:39:02 AM
PHPRunner General questions
O
ole author

Hello,
I have following problem:
I have an add page with two select boxes. When choose an option in the first selectbox, I automatically want to have the same selected option in the other selectbox. Therefore I wrote a small javascript, which I insterted in the add page.
SelectBox1.onchange = function()

{

if(SelectBox1.selectedIndex == 2)

{

document.editform.SelectBox2.selectedIndex = 2;

}

}
He displays it well on the add page. When I choose option 2 for SelectBox1, he automatically sets the selected value for SelectBox2 on 2.
However, when i do a submit, in the database, only the value of SelectBox1 is set to '2'. SelectBox2 remains empty.
Can anyone help me with this problem?

Thanks in advance.