Welcome Guest, Not a member yet? Register   Sign In
how to save the data from the listbox to the database
#11

[eluser]basty_dread[/eluser]
i guess there is no solution for this kind of problem.
#12

[eluser]basty_dread[/eluser]
ohh.. this is very clever..
Code:
<SELECT NAME="sections[]" MULTIPLE>
is this what i need to post all the values?

i mean with these NAME="selection[]" i can get all the values of the listbox.

thank you very much for helping me..
i really appreciate your effort. thank you
#13

[eluser]khagendra[/eluser]
Of course it works.

in the foreach loop the $sec gives u all the values selected in the list. this value u can store in the database. It depends on u, how u are manipulating with ur code.

Your problem was to store the selected values form list to database. u have problem working with array. i have given u the easiest way to get all the selected values from list.

within the foreach loop by taking $sec as selected values, u can pass this values to model to store in database.
#14

[eluser]khagendra[/eluser]
You are welcome!

Always happy to help u guys!
Cheers!
#15

[eluser]basty_dread[/eluser]
the codes worked.. i have now to use a javascript for selecting all the values in the listbox.. thank you very much khagendra..
#16

[eluser]basty_dread[/eluser]
Hello you had posted this code to my topic
Code:
<SELECT NAME="sections[]" MULTIPLE>

the
Code:
selection[]
is not working in javascript.



this is my javascript code for selecting all the values on the listbox without click all of them:

Code:
function selectin()
{
for(i=0;i<document.forms['frmcustom'].sections[].length;i++){
document.forms['frmcustom'].sections[i].selected=true;    
}
}

but its not working.
what could be wrong?

Please help me. Thank you again.
#17

[eluser]basty_dread[/eluser]
ive found the way.. thank you guys for helping me out.. Thank you so much and manythanks
#18

[eluser]khagendra[/eluser]
try like this it will work

Code:
function selectin()
{
for(i=0;i<document.forms['frmcustom'].sections[].length;i++){
document.forms['frmcustom'].sections[][i].selected=true;  // sections[][i]  
}
}




Theme © iAndrew 2016 - Forum software by © MyBB