Required Options - Bug?

I have searched for posts on this issue but cannot find - apologies if it has been covered…



Where an option is 'select' and I need it to be a 'required' option - if options are 'simultaneous' the first variant is selected by default and therefore even though the selected variant may not be the one the customer wants, if he/she doesn't change it it will get submitted anyway.



Simplest example is:



Gender [color=#ff0000]*[/color]:

Male

Female



By default, the first value is always selected on page render and therefore the 'required' condition is deemed to have been satisfied…



I do NOT want to fiddle about with 'forbidden' combinations to achieve this! If a select box is flagged as required it should display with a default first option of 'Please select…' which returns a null value and triggers the validation.



Grrrr…!

[quote name='Wilko' timestamp='1371481965' post='163785']

If a select box is flagged as required it should display with a default first option of 'Please select…' which returns a null value and triggers the validation.

[/quote]



Looking for this also, and Wilko is absolutely correct. 'Please select…' or 'Select below…' as a display only option is the correct way to do this in order to validate selection boxes.



One of my clients makes custom jewelry and if someone fails to pick the option they want b/c there is no select box validation, she'll end up making a custom order incorrectly.



Has anyone solved this issue? I searched and also checked documentation and did not find anything.

Same problem here !

Hi all,

I am writing code of sorting and pagination functionality in the agents and manufactures tables(admin panel).But, It is not working that functionality. I don't Know mistakes. Please help them.

File path:- app\functions\fn.companies.php.

function code:-

function fn_get_agents($params, $items_per_page = 0, $lang_code = CART_LANGUAGE){
// Init filter
$params = LastView::instance()->update('agt_data', $params);
// Set default values to input params
$default_params = array (
'page' => 1,
'items_per_page' => $items_per_page,
'get_hidden' => true
);
$params = array_merge($default_params, $params);
$fields = array (
'?:users_agents.agent_id',
'?:users_agents.agt_name',
'?:users_agents.agt_company',
'?:users_agents.agt_email',
'?:users_agents.agt_phone',
'?:users_agents.agt_joined',
'?:users_agents.agt_status',
);
// Define sort fields
$sortings = array (
'id' => '?:users_agents.agent_id',
'name' => '?:users_agents.agt_name',
'email' => '?:users_agents.agt_email',
'date' => '?:users_agents.agt_joined',
'phone' => '?:users_agents.agt_phone',
'status' => '?:users_agents.agt_status',
);
/*echo "
";
print_r($sortings);
echo "";
exit;*/
$condition = $join = $group = '';
$condition .= fn_get_company_condition('?:users_agents.agent_id');
if (isset($params['name'])) {
$condition .= db_quote(" AND ?:users_agents.agt_name LIKE ?l", "%".trim($params['name'])."%");
}
if (!empty($params['status'])) {
if (is_array($params['status'])) {
$condition .= db_quote(" AND ?:users_agents.agt_status IN (?a)", $params['status']);
} else {
$condition .= db_quote(" AND ?:users_agents.agt_status = ?s", $params['status']);
}
}
if (isset($params['email'])) {
$condition .= db_quote(" AND ?:users_agents.agt_email LIKE ?l", "%".trim($params['email'])."%");
}
if (isset($params['address'])) {
$condition .= db_quote(" AND ?:users_agents.agt_address LIKE ?l", "%".trim($params['address'])."%");
}
if (isset($params['date'])) {
$condition .= db_quote(" AND ?:users_agents.agt_joined LIKE ?l", "%".trim($params['date'])."%");
}
if (isset($params['zipcode'])) {
$condition .= db_quote(" AND ?:users_agents.zipcode LIKE ?l", "%".trim($params['zipcode'])."%");
}
if (!empty($params['country'])) {
$condition .= db_quote(" AND ?:users_agents.agt_country = ?s", $params['country']);
}
if (isset($params['state'])) {
$condition .= db_quote(" AND ?:users_agents.agt_state LIKE ?l", "%".trim($params['state'])."%");
}
if (isset($params['city'])) {
$condition .= db_quote(" AND ?:users_agents.agt_city LIKE ?l", "%".trim($params['city'])."%");
}
if (isset($params['phone'])) {
$condition .= db_quote(" AND ?:users_agents.agt_phone LIKE ?l", "%".trim($params['phone'])."%");
}
if (isset($params['fax'])) {
$condition .= db_quote(" AND ?:users_agents.agt_fax LIKE ?l", "%".trim($params['fax'])."%");
}
if (!empty($params['id'])) {
$condition .= db_quote(' AND ?:users_agents.agent_id IN (?n)', $params['id']);
}
fn_set_hook('get_agents', $params, $fields, $sortings, $condition, $join);
$sorting = db_sort($params, $sortings, 'name', 'DESC');
$limit = '';
if (!empty($params['items_per_page'])) {
$params['total_items'] = db_get_field("SELECT COUNT(*) FROM ?:users_agents $join WHERE 1 $condition");
$limit = db_paginate($params['page'], $params['items_per_page'], $params['total_items']);
}
$agt_data = db_get_array("SELECT " . implode(', ', $fields) . " FROM ?:users_agents $join WHERE 1 $condition $group $sorting $limit ");
return array($agt_data, $params);
}
related controller file:
app\controllers\backend\profiles.php
code:-
if ($mode == 'agts') {
list($agents_data, $search) = fn_get_agents($_REQUEST, Registry::get('settings.Appearance.admin_elements_per_page'), DESCR_SL);
Tygh::$app['view']->assign('search', $search);
Tygh::$app['view']->assign('agents_data', $agents_data);
}

Regards,

Naga mahesh bondada,

maheshbondada2@gmail.com,

7893772765.

@nagamahesh22 what does you post have to do with the topic of this thread?

Please post your question in the troubleshooting/tips section and please use "code" tags so your code is readable and not formatted as a document.