Page 1 of 1

updateing database with some javascript

Posted: Sun May 16, 2010 6:22 am
by nite4000
Hey I posted on my last post but guess no one saw it but here is what I have.

On my last post i messed up with what I thought i had to do so here is what has to be done


i have 16 boxes 4 on each table row and a chk box next to each first box when the box is checked the 4 boxes are enabled allowed to be typed in. when unchked its not typeable.

Now i have a submit button when I chk one I want to insert a record into my table and when unchked I want to remove the record completely.
I also need to be able to alter text in boxes then update the table long as they are still enabled.

I hope someone can help. I have the JS code for the enabled and disable of the boxes.


Thanks

Re: updateing database with some javascript

Posted: Sun May 16, 2010 10:13 pm
by yacahuma
Take one step at a time. Do a print_r($_POST). See what is you are dealing with. if you wish, post your print_r output to see what you have. Some where you are going to have a function like

Code: Select all

function update($_POST)
{
   if (checked())
       insert into db
   else 
       delete from db
}