Jump to content

Saving d values to a txt file+checkbox validation


ashishrathore

Recommended Posts

hello all,thankx 4 ur all advice uptilll nwther is 1 more that i am stuc into,it goes like thisthere is one web page in which some checkboxes are displayed(these value i take from a text file) like this- SELECT SUBCATEGORY:--- i) Checkbox1 ii) Checkbox2 iii) Checkbox3 ............... ...............The code is smwhat like this....------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------<?php $clines = file('temp.txt'); foreach ($clines as $cln) { ////foreach STARTS $data = explode(";",$cln); $length = count($data); ?> <input type=checkbox name="main[]" value="<?php echo "$mainh"; ?>"><?php echo "$data[0]"; ?><br> <?php for($j=1;$j<$length-2;$j++) { //////for starts $sub = $data[$j]; $subname = $mainh.$j; ?> <input type=checkbox name="sub[]" value="<?php echo "$subname"; ?>" ><?php echo "$sub"; ?><br> <?php } ?> }-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------->>> now first of all i want to validate these checkboxes ie if no checkboxes are selected then it should prompt.>>>>> Other thing is when the selected checboxes are checked, then they must be posted to another page and from there they are saved to a text fileie. suppose Checkbox2, Checkbox5, Checkbox6 are checked then they must be posted to another page and after that they must be saved to a new txt file

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...