hy, if you have found the answer plz send me a copy... i'm having the same type of problems... I want to modify or to create a new select option when someone clicks a button. 1. I extract some values from a database 2. i want when someone clicks a button, in the same page, to load other values from the database and put them there
it's a sort of dynamic loading ... thanks for reading and i will help you if could solve this problem.. the part with inserting values from database to the form is done but the rest of the part is done in a javascript function that does not works... > > From: "Smita Manohar" <[EMAIL PROTECTED]> > Date: 2002/09/25 Wed PM 06:20:48 GMT+03:00 > To: [EMAIL PROTECTED] > Subject: [PHP-DB] php and javascript > > hii all, > in my php script, im havin one form, in which having checkboxes. values for > which are coming from database, and i want to do some action for checked > vales. so i create array of that checkbox. > now i want to include one link for "Check All" which helps user to check all > boxes in single click. since that form is too big, i dont want to reload the > entire page. hence trying to use javascript for this stuff. > > i've included one more check box for "Check All" > which is used as, > <INPUT type="checkbox" name="chk_select_all" > onclick="javascript : func_select_all()"> > > which when clicked invokes function to select all checkboxes. > > the function func_select_all has been defined in the <head> </head> > as, > <script language=javascript> > function func_select_all() > { > > if(document.subj_frm.chk_select_all.checked) > { > for(i=0;i<num_rows ; i++) //num_rows variables have been defiened > in the beginning. > { > document.subj_frm.chk_id[i].checked=true > } > } > else > { > for(i=0;i<=num_rows; i++) > { > document.subj_frm.chk_id[i].checked=false > } > } > > } > </script> > > the phpscript where i print checkboxes is, > > while ($row = mysql_fetch_array($result)) > { > . > . > . > echo " <td align=center><input type=checkbox name=chk_id[] > value=".$row["subj_id"]."> </td> "; // values for which > are coming from database > > . > . > . > } > now in the above line (in phpscript) name of the checkbox is chk_id[] i > should define it as array, since i have to pass array of all checked values. > but when i select the check box named, chk_select_all (see above code) it > goes to the function defined in javascript func_select_all but there it > gives error for checkbox name, since i've defined it as an array(in > phpscript), instead if in my phpscript i dont specify it as an array, ie, > echo " <td align=center><input type=checkbox name=chk_id > value=".$row["subj_id"]."> </td> "; > > javascript function works fine, and it selects all checkbox values. but in > that case, my php code doesn't work fine, since checkbox value is not array, > it cant remeber checked values. > > can anyone pls suggest something? of can give other solution to "check all" > values without reloading the page > > thanks in advance > smita. > > > > _________________________________________________________________ > MSN Photos is the easiest way to share and print your photos: > http://photos.msn.com/support/worldwide.aspx > > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > Free Email Account at www.flash.ro -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php