-
Problem with divs and horizontal rules
Ok firstly with regards to background image. You have a background image set in stylecontact.css body { font-size: 62.5%; font-family: Helvetica, sans-serif; background: url(images/stripe.png) repeat; } This image doesn't seem to exist in it's location but it is overwriting the correct background image set in style.css body { width: 962px; margin: 0 auto; background-color: #ffffff; background-image: url('images/images.jpg'); background-attachment: fixed; background-repeat: repeat-x; } With regards to border, on your contact page you have the footer div outside of the container div whereas you have it inside on every other page. Can't answer your problem with <hr> and read more links. As far as dropping the Nav onto the slider there a re a few things stopping it. Firstly the 3 image classes for social link each have padding-top:10px ... remove it. Then change the div height from 52px to 100% on navigationhome & social .. That should do it !
-
Echo Option Value
Fair enough, misunderstanding !
-
Echo Option Value
Lyndsey thanks again for that, i can see what you mean, and i had assumed that it would work that way, but unfortunately it's not working. I guess i can afford to lose the styling and just remove the opacity .. then it will at least be functional, if not as aesthetically pleasing ... I really appreciate your help Lyndsey and i actually did learn something from your first suggestion. Thanks again !!!
-
Echo Option Value
Unfortunately i can't afford to pay a "Web Person" to do it for me, as this is a non profit project for my own fun. I have asked for help here and a couple of people have been really helpfull in trying to work out the problem. If it gets to much for them i fully understand and i will continue to appreciate the help which they have given me. Lyndsey has attempted to help me, and although her method did not work in this case, it was a great learning experience for me, for which i am greatly appreciative. This is an opensource cms which id did not build but i am trying to learn. I struggle to see how anyone on this forum could benefit from you jumping on a thread, suggesting payment and criticizing somebody elses work ... especially when it is an active thread that people are involved in solving ...
-
Echo Option Value
Thanks for your time .. I really do appreciate it ... Basically in the code below there are 11 Select boxes and a number of input boxes. This is the section of the form specifically for Car Details ... As i said before the select boxes work correctly, but the opacity makes it invisible. So basically i want to somehow apply the option value to the span class on each select box .... basically the same technique is used (and working) on the upper part of the form, but i am trying to make a plugin function in the same way unfortunately the upper part is so difficult to get to the source of. I'll show some code from it show you what i mean. So a select box on the working form is like so <div class="control-group"> <label class="control-label" for="country"><?php _e('Country', 'bender'); ?></label> <div class="controls"> <?php ItemForm::country_select(osc_get_countries(), osc_user()); ?> </div> </div> But that outputs html like so .. <div class="control-group"> <label class="control-label" for="country">Country</label> <div class="controls"> <div class="select-box undefined"><select name="countryId" id="countryId" style="opacity: 0;"><option value="">Select a country...</option><option value="IE">Ireland</option><option value="NI">Northern Ireland</option></select><a href="#" class="select-box-trigger"><span class="select-box-label">Select a country...</span><span class="select-box-icon">0</span></a></div> </div> </div> So basically i am trying to do the same with the following page <script type="text/javascript"> $(document).ready(function(){ $("#make").change(function(){ var make_id = $(this).val(); var url = '<?php echo osc_ajax_plugin_url('cars_attributes/ajax.php') . '&makeId='; ?>' + make_id; var result = ''; if(make_id != '') { $("#model").attr('disabled',false); $.ajax({ type: "POST", url: url, dataType: 'json', success: function(data){ var length = data.length; if(length > 0) { result += '<option value="" selected><?php _e('Select a model', 'cars_attributes'); ?></option>'; for(key in data) { result += '<option value="' + data[key].pk_i_id + '">' + data[key].s_name + '</option>'; } } else { result += '<option value=""><?php _e('No results', 'cars_attributes'); ?></option>'; } $("#model").html(result); } }); } else { result += '<option value="" selected><?php _e('Select a model', 'cars_attributes'); ?></option>'; $("#model").attr('disabled',true); $("#model").html(result); } }); }); </script> </br> <h2><?php _e('Car Details', 'cars_attributes') ; ?></h2> <div> <div class="control-group"> <?php if( Session::newInstance()->_getForm('pc_make') != '' ) { $detail['fk_i_make_id'] = Session::newInstance()->_getForm('pc_make'); } ?> <label class="control-label"><?php _e('Make', 'cars_attributes'); ?></label> <div class="controls"> <div class="select-box "> <select name="make" id="make" style="opacity: 0;"> <option value="" selected><?php _e('Select a make...', 'cars_attributes'); ?></option> <?php foreach($makes as $a){ ?> <option value="<?php echo $a['pk_i_id']; ?>" <?php if(@$detail['fk_i_make_id'] == $a['pk_i_id']) { echo 'selected'; } ?>><?php echo $a['s_name']; ?></option> <?php } ?> </select> <a href="#" class="select-box-trigger"><span class="select-box-label"></span><span class="select-box-icon">0</span></a> </div> </div> </div> <div class="control-group"> <?php if( Session::newInstance()->_getForm('pc_model') != '' ) { $detail['fk_i_model_id'] = Session::newInstance()->_getForm('pc_model'); } ?> <label class="control-label"><?php _e('Model', 'cars_attributes'); ?></label> <div class="controls"> <div class="select-box "> <select name="model" id="model" style="opacity: 0;"> <option value="" selected><?php _e('Select a model', 'cars_attributes'); ?></option> <?php foreach($models as $a) { ?> <option value="<?php echo $a['pk_i_id']; ?>" <?php if(@$detail['fk_i_model_id'] == $a['pk_i_id']) { echo 'selected'; } ?>><?php echo $a['s_name']; ?></option> <?php }?> </select> <a href="#" class="select-box-trigger"><span class="select-box-label"></span><span class="select-box-icon">0</span></a> </div> </div> </div> <div class="control-group"> <?php $locales = osc_get_locales(); if( Session::newInstance()->_getForm('pc_car_type') != '' ) { $detail['fk_vehicle_type_id'] = Session::newInstance()->_getForm('pc_car_type'); } if(count($locales)==1) { $locale = $locales[0]; ?> <p> <label class="control-label"><?php _e('Car type', 'cars_attributes'); ?></label> <div class="controls"> <div class="select-box "> <select name="car_type" id="car_type" > <option value="" selected><?php _e('Select a car type', 'cars_attributes'); ?></option> <?php foreach($car_types[$locale['pk_c_code']] as $k => $v) { ?> <option value="<?php echo $k; ?>" <?php if(@$detail['fk_vehicle_type_id'] == $k) { echo 'selected'; } ?>><?php echo @$v; ?></option> <?php } ?> </select> <a href="#" class="select-box-trigger"><span class="select-box-icon">0</span></a> </div> </div> </p> <?php } else { ?> <div class="tabber"> <?php foreach($locales as $locale) {?> <div class="tabbertab"> <h2><?php echo $locale['s_name']; ?></h2> <p> <label class="control-label"><?php _e('Car type', 'cars_attributes'); ?></label> <div class="controls"> <div class="select-box "> <select name="car_type" id="car_type" > <option value="" selected><?php _e('Select a car type', 'cars_attributes'); ?></option> <?php foreach($car_types[$locale['pk_c_code']] as $k => $v) { ?> <option value="<?php echo $k; ?>" <?php if(@$detail['fk_vehicle_type_id'] == $k) { echo 'selected'; } ?>><?php echo @$v; ?></option> <?php } ?> </select> <a href="#" class="select-box-trigger"><span class="select-box-icon">0</span></a> </div> </div> </p> </div> <?php } ?> </div> <?php } ?> </div> <div class="control-group"> <?php if( Session::newInstance()->_getForm('pc_year') != '' ) { $detail['i_year'] = Session::newInstance()->_getForm('pc_year'); } ?> <label class="control-label"><?php _e('Year', 'cars_attributes'); ?></label> <div class="controls"> <input type="text" name="year" id="year" value="<?php echo @$detail['i_year']; ?>" size=4 /> </div> </div> <div class="control-group"> <?php if( Session::newInstance()->_getForm('pc_doors') != '' ) { $detail['i_doors'] = Session::newInstance()->_getForm('pc_doors'); } ?> <label class="control-label"><?php _e('Doors', 'cars_attributes'); ?></label> <div class="controls"> <div class="select-box "> <select name="doors" id="doors" > <option value=""><?php _e('Select num. of doors', 'cars_attributes'); ?></option> <?php foreach(range(3, 5) as $n) { ?> <option value="<?php echo $n; ?>" <?php if(@$detail['i_doors'] == $n) { echo 'selected'; } ?>><?php echo $n; ?></option> <?php } ?> </select> <a href="#" class="select-box-trigger"><span class="select-box-icon">0</span></a> </div> </div> </div> <div class="control-group"> <?php if( Session::newInstance()->_getForm('pc_seats') != '' ) { $detail['i_seats'] = Session::newInstance()->_getForm('pc_seats'); } ?> <label class="control-label"><?php _e('Seats', 'cars_attributes'); ?></label> <div class="controls"> <div class="select-box "> <select name="seats" id="seats" > <option value=""><?php _e('Select num. of seats', 'cars_attributes'); ?></option> <?php foreach(range(1, 17) as $n) { ?> <option value="<?php echo $n; ?>" <?php if(@$detail['i_seats'] == $n) { echo 'selected'; } ?>><?php echo $n; ?></option> <?php } ?> </select> <a href="#" class="select-box-trigger"><span class="select-box-icon">0</span></a> </div> </div> </div> <div class="control-group"> <?php if( Session::newInstance()->_getForm('pc_mileage') != '' ) { $detail['i_mileage'] = Session::newInstance()->_getForm('pc_mileage'); } ?> <label class="control-label"><?php _e('Mileage', 'cars_attributes'); ?></label> <div class="controls"> <input type="text" name="mileage" id="mileage" value="<?php echo @$detail['i_mileage']; ?>" /> </div> </div> <div class="control-group"> <?php if( Session::newInstance()->_getForm('pc_engine_size') != '' ) { $detail['i_engine_size'] = Session::newInstance()->_getForm('pc_engine_size'); } ?> <label class="control-label"><?php _e('Engine size (cc)', 'cars_attributes'); ?></label> <div class="controls"> <input type="text" name="engine_size" id="engine_size" value="<?php echo @$detail['i_engine_size']; ?>" /> </div> </div> <div class="control-group>"> <?php if( Session::newInstance()->_getForm('pc_num_airbags') != '' ) { $detail['i_num_airbags'] = Session::newInstance()->_getForm('pc_num_airbags'); } ?> <label class="control-label"><?php _e('Num. Airbags', 'cars_attributes'); ?></label> <div class="controls"> <div class="select-box "> <select name="num_airbags" id="num_airbags" > <option value=""><?php _e('Select num. of airbags', 'cars_attributes'); ?></option> <?php foreach(range(1, as $n) { ?> <option value="<?php echo $n; ?>" <?php if(@$detail['i_num_airbags'] == $n) { echo 'selected'; } ?>><?php echo $n; ?></option> <?php } ?> </select> <a href="#" class="select-box-trigger"><span class="select-box-icon">0</span></a> </div> </div> </div> <div class="control-group"> <?php if( Session::newInstance()->_getForm('pc_transmission') != '' ) { $detail['e_transmission'] = Session::newInstance()->_getForm('pc_transmission'); } ?> <label class="control-label"><?php _e('Transmission', 'cars_attributes'); ?></label> <div class="controls"> <div class="select-box "> <select name="transmission" id="transmission" > <option value="MANUAL" <?php if(@$detail['e_transmission'] == 'MANUAL') { echo 'selected'; } ?>><?php _e('Manual', 'cars_attributes'); ?></option> <option value="AUTO" <?php if(@$detail['e_transmission'] == 'AUTO') { echo 'selected'; } ?>><?php _e('Auto', 'cars_attributes'); ?></option> </select> <a href="#" class="select-box-trigger"><span class="select-box-icon">0</span></a> </div> </div> </div> <div class="control-group"> <?php if( Session::newInstance()->_getForm('pc_fuel') != '' ) { $detail['e_fuel'] = Session::newInstance()->_getForm('pc_fuel'); } ?> <label class="control-label"><?php _e('Fuel', 'cars_attributes'); ?></label> <div class="controls"> <div class="select-box "> <select name="fuel" id="fuel" > <option value="DIESEL" <?php if(@$detail['e_fuel'] == 'DIESEL') { echo 'selected'; } ?>><?php _e('Diesel', 'cars_attributes'); ?></option> <option value="GASOLINE" <?php if(@$detail['e_fuel'] == 'GASOLINE') { echo 'selected'; } ?>><?php _e('Gasoline', 'cars_attributes'); ?></option> <option value="ELECTRIC-HIBRID" <?php if(@$detail['e_fuel'] == 'ELECTRIC-HIBRID') { echo 'selected'; } ?>><?php _e('Electric-hibrid', 'cars_attributes'); ?></option> <option value="OTHER" <?php if(@$detail['e_fuel'] == 'OTHER') { echo 'selected'; } ?>><?php _e('Other', 'cars_attributes'); ?></option> </select> <a href="#" class="select-box-trigger"><span class="select-box-icon">0</span></a> </div> </div> </div> <div class="control-group"> <?php if( Session::newInstance()->_getForm('pc_seller') != '' ) { $detail['e_seller'] = Session::newInstance()->_getForm('pc_seller'); } ?> <label class="control-label"><?php _e('Seller', 'cars_attributes'); ?></label> <div class="controls"> <div class="select-box "> <select name="seller" id="seller" > <option value="DEALER" <?php if(@$detail['e_seller'] == 'DEALER') { echo 'selected'; } ?>><?php _e('Dealer', 'cars_attributes'); ?></option> <option value="OWNER" <?php if(@$detail['e_seller'] == 'OWNER') { echo 'selected'; } ?>><?php _e('Owner', 'cars_attributes'); ?></option> </select> <a href="#" class="select-box-trigger"><span class="select-box-icon">0</span></a> </div> </div> </div> <div class="control-group"> <?php if( Session::newInstance()->_getForm('pc_warranty') != '' ) { $detail['b_warranty'] = Session::newInstance()->_getForm('pc_warranty'); } ?> <label class="control-label"><?php _e('Warranty', 'cars_attributes'); ?></label> <div class="controls"> <input type="checkbox" name="warranty" id="warranty" value="1" <?php if(@$detail['b_warranty'] == 1) { echo 'checked="yes"'; } ?> /> </div> </div> <div class="control-group"> <?php if( Session::newInstance()->_getForm('pc_new') != '' ) { $detail['b_new'] = Session::newInstance()->_getForm('pc_new'); } ?> <label class="control-label"><?php _e('New', 'cars_attributes'); ?></label> <div class="controls"> <input type="checkbox" name="new" id="new" value="1" <?php if(@$detail['b_new'] == 1) { echo 'checked="yes"'; } ?> /> </div> </div> <div class="control-group"> <?php if( Session::newInstance()->_getForm('pc_power_unit') != '' ) { $detail['e_power_unit'] = Session::newInstance()->_getForm('pc_power_unit'); } if( Session::newInstance()->_getForm('pc_power') != '' ) { $detail['i_power'] = Session::newInstance()->_getForm('pc_power'); } ?> <label class="control-label"><?php _e('Power', 'cars_attributes'); ?></label> <div class="controls"> <input type="text" name="power" id="power" value="<?php echo @$detail['i_power']; ?>" /> <div class="select-box "> <select name="power_unit" id="power_unit" > <option value="KW" <?php if(@$detail['e_power_unit'] == 'KW') { echo 'selected'; } ?>><?php _e('Kw', 'cars_attributes'); ?></option> <option value="CV" <?php if(@$detail['e_power_unit'] == 'CV') { echo 'selected'; } ?>><?php _e('Cv', 'cars_attributes'); ?></option> <option value="CH" <?php if(@$detail['e_power_unit'] == 'CH') { echo 'selected'; } ?>><?php _e('Ch', 'cars_attributes'); ?></option> <option value="KM" <?php if(@$detail['e_power_unit'] == 'KM') { echo 'selected'; } ?>><?php _e('Km', 'cars_attributes'); ?></option> <option value="HP" <?php if(@$detail['e_power_unit'] == 'HP') { echo 'selected'; } ?>><?php _e('Hp', 'cars_attributes'); ?></option> <option value="PS" <?php if(@$detail['e_power_unit'] == 'PS') { echo 'selected'; } ?>><?php _e('Ps', 'cars_attributes'); ?></option> <option value="PK" <?php if(@$detail['e_power_unit'] == 'PK') { echo 'selected'; } ?>><?php _e('Pk', 'cars_attributes'); ?></option> <option value="CP" <?php if(@$detail['e_power_unit'] == 'CP') { echo 'selected'; } ?>><?php _e('Cp', 'cars_attributes'); ?></option> </select> <a href="#" class="select-box-trigger"><span class="select-box-icon">0</span></a> </div> </div> </div> <div class="row auto"> <?php if( Session::newInstance()->_getForm('pc_gears') != '' ) { $detail['i_gears'] = Session::newInstance()->_getForm('pc_gears'); } ?> <label class="control-label"><?php _e('Gears', 'cars_attributes'); ?></label> <div class="controls"> <div class="select-box "> <select name="gears" id="gears" > <option value=""><?php _e('Select num. of gears', 'cars_attributes'); ?></option> <?php foreach(range(1, as $n) { ?> <option value="<?php echo $n; ?>" <?php if(@$detail['i_gears'] == $n) { echo 'selected'; } ?>><?php echo $n; ?></option> <?php } ?> </select> <a href="#" class="select-box-trigger"><span class="select-box-icon">0</span></a> </div> </div> </div> </div> <script type="text/javascript"> tabberAutomatic(); </script> Over my head lol ... again .. Thank you so much for your time !!
-
Echo Option Value
Yes no problem .. You will need to sign in, but you can use the test user details below or feel free to login with Facebook. URL: http://ads-ni.co.uk/user/login user=admin@ultrawebtemplates.com pass=123456 Then you will need to hit "Publish Your Ad For Free" On the listing page Select Vehicles from the Category, to load this part of the form. As you can see under Car Details, the first 2 selects have opacity set but the others do not. And your proposed jQuery edit is still in place !! Sorry i couldn't make access simpler, really appreciate your help on this !!
-
Echo Option Value
Yeh, basically what ever i select in #make, is applied to other select boxes. See attached image. You will see that the selects from Car type down have not had the opacity applied, so they are showing the correct value as any normal select box would but every box with a grey background is using this unconventional method.
-
Echo Option Value
AHHH .. Ok on first impressions it worked, but then i realised it changes the value on all select boxes .. there are multiple select boxes on the page .. My bad .. i probably should have told you that !! Sorry
-
Echo Option Value
Lyndsey that appears to be exactly what i am looking for .. Unfortunately i have no idea where to place it. I am a total newbie !! I didn't actually write the code above, i am just trying to modify ! Can you point me in the right direction ? Thank you soooo much for your help !
-
Echo Option Value
Greatly appreciate your response, but i need to echo the value as a label in the span tags below it. This is not my design, so it is a little unconventional. There is styling applied to the select box which only works by setting an opacity on the select box, which then also makes the select values also invisible. So the label is called in another div below <a href="#" class="select-box-trigger"><span class="select-box-label">DYNAMICALLY APPLY LABEL HERE BASED ON SELECT VALUE</span><span class="select-box-icon">0</span></a> So basically where i have DYNAMICALLY APPLY LABEL HERE BASED ON SELECT VALUE .. i would like to place some code to echo the value to be used as a label. Do you get me ?
-
Echo Option Value
Can anyone PLEASE tell me how to echo the Option value to show as class="select-box-label">OPTION VALUE< It's just towards the end on the code below ... Really appreciate any help .. Thanks <script type="text/javascript"> $(document).ready(function(){ $("#make").change(function(){ var make_id = $(this).val(); var url = '<?php echo osc_ajax_plugin_url('cars_attributes/ajax.php') . '&makeId='; ?>' + make_id; var result = ''; if(make_id != '') { $("#model").attr('disabled',false); $.ajax({ type: "POST", url: url, dataType: 'json', success: function(data){ var length = data.length; if(length > 0) { result += '<option value="" selected><?php _e('Select a model', 'cars_attributes'); ?></option>'; for(key in data) { result += '<option value="' + data[key].pk_i_id + '">' + data[key].s_name + '</option>'; } } else { result += '<option value=""><?php _e('No results', 'cars_attributes'); ?></option>'; } $("#model").html(result); } }); } else { result += '<option value="" selected><?php _e('Select a model', 'cars_attributes'); ?></option>'; $("#model").attr('disabled',true); $("#model").html(result); } }); }); </script> <h2><?php _e('Car Details', 'cars_attributes') ; ?></h2> <div> <div class="control-group"> <?php if( Session::newInstance()->_getForm('pc_make') != '' ) { $detail['fk_i_make_id'] = Session::newInstance()->_getForm('pc_make'); } ?> <label class="control-label"><?php _e('Make', 'cars_attributes'); ?></label> <div class="controls"> <div class="select-box "> <select name="make" id="make" style="opacity: 0;"> <option value="" selected><?php _e('Select a make...', 'cars_attributes'); ?></option> <?php foreach($makes as $a){ ?> <option value="<?php echo $a['pk_i_id']; ?>" <?php if(@$detail['fk_i_make_id'] == $a['pk_i_id']) { echo 'selected'; } ?>><?php echo $a['s_name']; ?></option> <?php } ?> </select> <a href="#" class="select-box-trigger"><span class="select-box-label">DYNAMICALLY APPLY LABEL HERE BASED ON SELECT VALUE</span><span class="select-box-icon">0</span></a> </div> </div> </div>
-
Osclass Anybody ?
Hey guys, i'm working on an osclass site .. Anybody familiar ? Basically my problem is converting a plugin to match a theme style for select boxes. The way the theme was designed the select boxes are set with an opacity of 0, with the style applied to another div and a label applied yet in another div. This works great in some places and creates a great look, however with the page attached below i need to dynamically create the label based on the select value, which i am a bit stumped with ... Would be greatful if someone could take a look and point me in the right direction ... First example is around line 51 in the code which looks like this <a href="#" class="select-box-trigger"><span class="select-box-label">DYNAMICALLY APPLY LABEL HERE BASED ON SELECT VALUE</span><span class="select-box-icon">0</span></a> i have added full page code as there is some script at the top which is of relevance. <script type="text/javascript"> $(document).ready(function(){ $("#make").change(function(){ var make_id = $(this).val(); var url = '<?php echo osc_ajax_plugin_url('cars_attributes/ajax.php') . '&makeId='; ?>' + make_id; var result = ''; if(make_id != '') { $("#model").attr('disabled',false); $.ajax({ type: "POST", url: url, dataType: 'json', success: function(data){ var length = data.length; if(length > 0) { result += '<option value="" selected><?php _e('Select a model', 'cars_attributes'); ?></option>'; for(key in data) { result += '<option value="' + data[key].pk_i_id + '">' + data[key].s_name + '</option>'; } } else { result += '<option value=""><?php _e('No results', 'cars_attributes'); ?></option>'; } $("#model").html(result); } }); } else { result += '<option value="" selected><?php _e('Select a model', 'cars_attributes'); ?></option>'; $("#model").attr('disabled',true); $("#model").html(result); } }); }); </script> <h2><?php _e('Car Details', 'cars_attributes') ; ?></h2> <div> <div class="control-group"> <?php if( Session::newInstance()->_getForm('pc_make') != '' ) { $detail['fk_i_make_id'] = Session::newInstance()->_getForm('pc_make'); } ?> <label class="control-label"><?php _e('Make', 'cars_attributes'); ?></label> <div class="controls"> <div class="select-box "> <select name="make" id="make" style="opacity: 0;"> <option value="" selected><?php _e('Select a make...', 'cars_attributes'); ?></option> <?php foreach($makes as $a){ ?> <option value="<?php echo $a['pk_i_id']; ?>" <?php if(@$detail['fk_i_make_id'] == $a['pk_i_id']) { echo 'selected'; } ?>><?php echo $a['s_name']; ?></option> <?php } ?> </select> <a href="#" class="select-box-trigger"><span class="select-box-label">DYNAMICALLY APPLY LABEL HERE BASED ON SELECT VALUE</span><span class="select-box-icon">0</span></a> </div> </div> </div> <div class="control-group"> <?php if( Session::newInstance()->_getForm('pc_model') != '' ) { $detail['fk_i_model_id'] = Session::newInstance()->_getForm('pc_model'); } ?> <label class="control-label"><?php _e('Model', 'cars_attributes'); ?></label> <div class="controls"> <div class="select-box "> <select name="model" id="model" style="opacity: 0;"> <option value="" selected><?php _e('Select a model', 'cars_attributes'); ?></option> <?php foreach($models as $a) { ?> <option value="<?php echo $a['pk_i_id']; ?>" <?php if(@$detail['fk_i_model_id'] == $a['pk_i_id']) { echo 'selected'; } ?>><?php echo $a['s_name']; ?></option> <?php }?> </select> <a href="#" class="select-box-trigger"><span class="select-box-icon">0</span></a> </div> </div> </div> <div class="control-group"> <?php $locales = osc_get_locales(); if( Session::newInstance()->_getForm('pc_car_type') != '' ) { $detail['fk_vehicle_type_id'] = Session::newInstance()->_getForm('pc_car_type'); } if(count($locales)==1) { $locale = $locales[0]; ?> <p> <label class="control-label"><?php _e('Car type', 'cars_attributes'); ?></label> <div class="controls"> <div class="select-box "> <select name="car_type" id="car_type" style="opacity: 0;"> <option value="" selected><?php _e('Select a car type', 'cars_attributes'); ?></option> <?php foreach($car_types[$locale['pk_c_code']] as $k => $v) { ?> <option value="<?php echo $k; ?>" <?php if(@$detail['fk_vehicle_type_id'] == $k) { echo 'selected'; } ?>><?php echo @$v; ?></option> <?php } ?> </select> <a href="#" class="select-box-trigger"><span class="select-box-icon">0</span></a> </div> </div> </p> <?php } else { ?> <div class="tabber"> <?php foreach($locales as $locale) {?> <div class="tabbertab"> <h2><?php echo $locale['s_name']; ?></h2> <p> <label class="control-label"><?php _e('Car type', 'cars_attributes'); ?></label> <div class="controls"> <div class="select-box "> <select name="car_type" id="car_type" style="opacity: 0;"> <option value="" selected><?php _e('Select a car type', 'cars_attributes'); ?></option> <?php foreach($car_types[$locale['pk_c_code']] as $k => $v) { ?> <option value="<?php echo $k; ?>" <?php if(@$detail['fk_vehicle_type_id'] == $k) { echo 'selected'; } ?>><?php echo @$v; ?></option> <?php } ?> </select> <a href="#" class="select-box-trigger"><span class="select-box-icon">0</span></a> </div> </div> </p> </div> <?php } ?> </div> <?php } ?> </div> <div class="control-group"> <?php if( Session::newInstance()->_getForm('pc_year') != '' ) { $detail['i_year'] = Session::newInstance()->_getForm('pc_year'); } ?> <label class="control-label"><?php _e('Year', 'cars_attributes'); ?></label> <div class="controls"> <input type="text" name="year" id="year" value="<?php echo @$detail['i_year']; ?>" size=4 /> </div> </div> <div class="control-group"> <?php if( Session::newInstance()->_getForm('pc_doors') != '' ) { $detail['i_doors'] = Session::newInstance()->_getForm('pc_doors'); } ?> <label class="control-label"><?php _e('Doors', 'cars_attributes'); ?></label> <div class="controls"> <div class="select-box "> <select name="doors" id="doors" style="opacity: 0;"> <option value=""><?php _e('Select num. of doors', 'cars_attributes'); ?></option> <?php foreach(range(3, 5) as $n) { ?> <option value="<?php echo $n; ?>" <?php if(@$detail['i_doors'] == $n) { echo 'selected'; } ?>><?php echo $n; ?></option> <?php } ?> </select> <a href="#" class="select-box-trigger"><span class="select-box-icon">0</span></a> </div> </div> </div> <div class="control-group"> <?php if( Session::newInstance()->_getForm('pc_seats') != '' ) { $detail['i_seats'] = Session::newInstance()->_getForm('pc_seats'); } ?> <label class="control-label"><?php _e('Seats', 'cars_attributes'); ?></label> <div class="controls"> <div class="select-box "> <select name="seats" id="seats" style="opacity: 0;"> <option value=""><?php _e('Select num. of seats', 'cars_attributes'); ?></option> <?php foreach(range(1, 17) as $n) { ?> <option value="<?php echo $n; ?>" <?php if(@$detail['i_seats'] == $n) { echo 'selected'; } ?>><?php echo $n; ?></option> <?php } ?> </select> <a href="#" class="select-box-trigger"><span class="select-box-icon">0</span></a> </div> </div> </div> <div class="control-group"> <?php if( Session::newInstance()->_getForm('pc_mileage') != '' ) { $detail['i_mileage'] = Session::newInstance()->_getForm('pc_mileage'); } ?> <label class="control-label"><?php _e('Mileage', 'cars_attributes'); ?></label> <div class="controls"> <input type="text" name="mileage" id="mileage" value="<?php echo @$detail['i_mileage']; ?>" /> </div> </div> <div class="control-group"> <?php if( Session::newInstance()->_getForm('pc_engine_size') != '' ) { $detail['i_engine_size'] = Session::newInstance()->_getForm('pc_engine_size'); } ?> <label class="control-label"><?php _e('Engine size (cc)', 'cars_attributes'); ?></label> <div class="controls"> <input type="text" name="engine_size" id="engine_size" value="<?php echo @$detail['i_engine_size']; ?>" /> </div> </div> <div class="control-group>"> <?php if( Session::newInstance()->_getForm('pc_num_airbags') != '' ) { $detail['i_num_airbags'] = Session::newInstance()->_getForm('pc_num_airbags'); } ?> <label class="control-label"><?php _e('Num. Airbags', 'cars_attributes'); ?></label> <div class="controls"> <div class="select-box "> <select name="num_airbags" id="num_airbags" style="opacity: 0;"> <option value=""><?php _e('Select num. of airbags', 'cars_attributes'); ?></option> <?php foreach(range(1, as $n) { ?> <option value="<?php echo $n; ?>" <?php if(@$detail['i_num_airbags'] == $n) { echo 'selected'; } ?>><?php echo $n; ?></option> <?php } ?> </select> <a href="#" class="select-box-trigger"><span class="select-box-icon">0</span></a> </div> </div> </div> <div class="control-group"> <?php if( Session::newInstance()->_getForm('pc_transmission') != '' ) { $detail['e_transmission'] = Session::newInstance()->_getForm('pc_transmission'); } ?> <label class="control-label"><?php _e('Transmission', 'cars_attributes'); ?></label> <div class="controls"> <div class="select-box "> <select name="transmission" id="transmission" style="opacity: 0;"> <option value="MANUAL" <?php if(@$detail['e_transmission'] == 'MANUAL') { echo 'selected'; } ?>><?php _e('Manual', 'cars_attributes'); ?></option> <option value="AUTO" <?php if(@$detail['e_transmission'] == 'AUTO') { echo 'selected'; } ?>><?php _e('Auto', 'cars_attributes'); ?></option> </select> <a href="#" class="select-box-trigger"><span class="select-box-icon">0</span></a> </div> </div> </div> <div class="control-group"> <?php if( Session::newInstance()->_getForm('pc_fuel') != '' ) { $detail['e_fuel'] = Session::newInstance()->_getForm('pc_fuel'); } ?> <label class="control-label"><?php _e('Fuel', 'cars_attributes'); ?></label> <div class="controls"> <div class="select-box "> <select name="fuel" id="fuel" style="opacity: 0;"> <option value="DIESEL" <?php if(@$detail['e_fuel'] == 'DIESEL') { echo 'selected'; } ?>><?php _e('Diesel', 'cars_attributes'); ?></option> <option value="GASOLINE" <?php if(@$detail['e_fuel'] == 'GASOLINE') { echo 'selected'; } ?>><?php _e('Gasoline', 'cars_attributes'); ?></option> <option value="ELECTRIC-HIBRID" <?php if(@$detail['e_fuel'] == 'ELECTRIC-HIBRID') { echo 'selected'; } ?>><?php _e('Electric-hibrid', 'cars_attributes'); ?></option> <option value="OTHER" <?php if(@$detail['e_fuel'] == 'OTHER') { echo 'selected'; } ?>><?php _e('Other', 'cars_attributes'); ?></option> </select> <a href="#" class="select-box-trigger"><span class="select-box-icon">0</span></a> </div> </div> </div> <div class="control-group"> <?php if( Session::newInstance()->_getForm('pc_seller') != '' ) { $detail['e_seller'] = Session::newInstance()->_getForm('pc_seller'); } ?> <label class="control-label"><?php _e('Seller', 'cars_attributes'); ?></label> <div class="controls"> <div class="select-box "> <select name="seller" id="seller" style="opacity: 0;"> <option value="DEALER" <?php if(@$detail['e_seller'] == 'DEALER') { echo 'selected'; } ?>><?php _e('Dealer', 'cars_attributes'); ?></option> <option value="OWNER" <?php if(@$detail['e_seller'] == 'OWNER') { echo 'selected'; } ?>><?php _e('Owner', 'cars_attributes'); ?></option> </select> <a href="#" class="select-box-trigger"><span class="select-box-icon">0</span></a> </div> </div> </div> <div class="control-group"> <?php if( Session::newInstance()->_getForm('pc_warranty') != '' ) { $detail['b_warranty'] = Session::newInstance()->_getForm('pc_warranty'); } ?> <label class="control-label"><?php _e('Warranty', 'cars_attributes'); ?></label> <div class="controls"> <input type="checkbox" name="warranty" id="warranty" value="1" <?php if(@$detail['b_warranty'] == 1) { echo 'checked="yes"'; } ?> /> </div> </div> <div class="control-group"> <?php if( Session::newInstance()->_getForm('pc_new') != '' ) { $detail['b_new'] = Session::newInstance()->_getForm('pc_new'); } ?> <label class="control-label"><?php _e('New', 'cars_attributes'); ?></label> <div class="controls"> <input type="checkbox" name="new" id="new" value="1" <?php if(@$detail['b_new'] == 1) { echo 'checked="yes"'; } ?> /> </div> </div> <div class="control-group"> <?php if( Session::newInstance()->_getForm('pc_power_unit') != '' ) { $detail['e_power_unit'] = Session::newInstance()->_getForm('pc_power_unit'); } if( Session::newInstance()->_getForm('pc_power') != '' ) { $detail['i_power'] = Session::newInstance()->_getForm('pc_power'); } ?> <label class="control-label"><?php _e('Power', 'cars_attributes'); ?></label> <div class="controls"> <input type="text" name="power" id="power" value="<?php echo @$detail['i_power']; ?>" /> <div class="select-box "> <select name="power_unit" id="power_unit" style="opacity: 0;"> <option value="KW" <?php if(@$detail['e_power_unit'] == 'KW') { echo 'selected'; } ?>><?php _e('Kw', 'cars_attributes'); ?></option> <option value="CV" <?php if(@$detail['e_power_unit'] == 'CV') { echo 'selected'; } ?>><?php _e('Cv', 'cars_attributes'); ?></option> <option value="CH" <?php if(@$detail['e_power_unit'] == 'CH') { echo 'selected'; } ?>><?php _e('Ch', 'cars_attributes'); ?></option> <option value="KM" <?php if(@$detail['e_power_unit'] == 'KM') { echo 'selected'; } ?>><?php _e('Km', 'cars_attributes'); ?></option> <option value="HP" <?php if(@$detail['e_power_unit'] == 'HP') { echo 'selected'; } ?>><?php _e('Hp', 'cars_attributes'); ?></option> <option value="PS" <?php if(@$detail['e_power_unit'] == 'PS') { echo 'selected'; } ?>><?php _e('Ps', 'cars_attributes'); ?></option> <option value="PK" <?php if(@$detail['e_power_unit'] == 'PK') { echo 'selected'; } ?>><?php _e('Pk', 'cars_attributes'); ?></option> <option value="CP" <?php if(@$detail['e_power_unit'] == 'CP') { echo 'selected'; } ?>><?php _e('Cp', 'cars_attributes'); ?></option> </select> <a href="#" class="select-box-trigger"><span class="select-box-icon">0</span></a> </div> </div> </div> <div class="row auto"> <?php if( Session::newInstance()->_getForm('pc_gears') != '' ) { $detail['i_gears'] = Session::newInstance()->_getForm('pc_gears'); } ?> <label class="control-label"><?php _e('Gears', 'cars_attributes'); ?></label> <div class="controls"> <div class="select-box "> <select name="gears" id="gears" style="opacity: 0;"> <option value=""><?php _e('Select num. of gears', 'cars_attributes'); ?></option> <?php foreach(range(1, as $n) { ?> <option value="<?php echo $n; ?>" <?php if(@$detail['i_gears'] == $n) { echo 'selected'; } ?>><?php echo $n; ?></option> <?php } ?> </select> <a href="#" class="select-box-trigger"><span class="select-box-icon">0</span></a> </div> </div> </div> </div> <script type="text/javascript"> tabberAutomatic(); </script>
-
Adding Check Box Values to Database
Thanks again, but i'm obviously going horribly wrong. I've implemented your code and the form seems to submit, but nothing actually gets added to the db table. It's no surprise really, as i am an absolute beginner !! To answer your question, there is only one field in the members table for "discs" .. i think if the discNos are added there seperated by commas, i am guessing that what the implode function does, that you have included in the second option. But any way i will post up my full code and see where i am going wrong. <?php session_start(); // Must start session first thing // Here we run a login check if (!isset($_SESSION['id'])) { header("location: login.php"); exit(); } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Add Discs</title> <style type="text/css"> <!-- body {margin: 0px} --> </style> </head> <body><?php //Connect to the database through our include include_once "connect_to_mysql.php"; // Query member data from the database and ready it for display $sql = "SELECT DISTINCT `DiscNo` FROM cdg ORDER BY `DiscNo` ASC"; $result = mysql_query($sql); if (!$result) { echo "Could not successfully run query ($sql) from DB: " . mysql_error(); exit; } if (mysql_num_rows($result) == 0) { echo "No rows found, nothing to print so am exiting"; exit; } while ($row = mysql_fetch_assoc($result)) { echo '<form>'; echo '<input type="checkbox" name="chk_group[]" value="' . $row["DiscNo"] .'" />' . $row["DiscNo"] . '<br />'; } if (isset($_POST['chk_group']) && !empty($_POST['chk_group'])){ $discs = array(); foreach($_POST['chk_group'] as $discNo) { $discs[]=$discNo; } if (!empty($discs)) { $discNos = implode(',',$discs); $q = "UPDATE members SET discNo = '{$discNos}' WHERE members_id = {$_SESSION['id']}"; } } mysql_free_result($result); ?> <input type="submit" name="Submit" value="Submit Form" /> </form> </body> </html> Thanks again for all your help.
-
Adding Check Box Values to Database
Appreciate that, it definitely tidies things up .. but how would i go about adding the checkbox values to the database ? Thanks again
-
SEO Advice please ?
I think no matter what i am gonna have to do something about it. It's all well and good having great Google results, but if it doesn't convert to sales, then it's worthless. Yeh the key words are very specific to one of our biggest brands and i'm guessing there isn't alot of competition, we kinda bounce about between position 2 & 7 with obviously the brands own website taking position 1 and a few of our main competitors following suit. I'll just keep flogging away at it .. Really appreciate your advice and professional opinion !! Thanks again Jason