EagerWolf Posted June 8, 2007 Share Posted June 8, 2007 Hi ... I've got a problem with checkbox group... <label> <input type='checkbox' name='tv1' value='1' id='tv1'/>DVD </label> <label> <input type='checkbox' name='tv1' value='2' id='tv1'/>VHS </label> <label> <input type='checkbox' name='tv1' value='3' checked='checked' id='tv1'/>SAT TV </label> The problem is if more values are being checked only last is strored (value 3) .... I read about storing values into array but I am not familiar with this ... Can anyone explain how is this done .. Thanks! BR Quote Link to comment Share on other sites More sharing options...
Stuie_b Posted June 8, 2007 Share Posted June 8, 2007 Like you say, you need too put the values into an array before sending them otherwise it wont work, The following edit will do just that, <label> <input type='checkbox' name='tv1[]' value='1' id='tv1'/>DVD </label> <label> <input type='checkbox' name='tv1[]' value='2' id='tv1'/>VHS </label> <label> <input type='checkbox' name='tv1[]' value='3' checked='checked' id='tv1'/>SAT TV </label> As you should be able too see the only thing needed to be done was too add brackets too the name (tv1[]) hope it helps Stuie Quote Link to comment Share on other sites More sharing options...
EagerWolf Posted June 10, 2007 Author Share Posted June 10, 2007 Thanks! Problem solved! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.