DuFF1 Posted January 19, 2009 Share Posted January 19, 2009 (edited) I added a dropdown field where the customer can choose his Job Title... Presently, the field number is stored instead of the field name. How can I store the field name instead the field number? <...> $job_title = tep_db_prepare_input($HTTP_POST_VARS['job_title']); <...> $sql_data_array = array('customers_firstname' => $firstname, 'customers_lastname' => $lastname, 'customers_job_title' => $job_title, 'customers_email_address' => $email_address, 'customers_telephone' => $telephone, 'customers_fax' => $fax, 'customers_newsletter' => $newsletter, 'customers_password' => tep_encrypt_password($password), 'customers_status' => $cust_status); <...> <tr> <td class="main"><?php echo ENTRY_JOB_TITLE; ?></td> <td class="main"><?php $job_title_array = array(); $job_title_query = tep_db_query("select job_title_id, job_title_name from " . JOB_TITLE . " order by job_title_name"); while ($job_title_values = tep_db_fetch_array($job_title_query)) { $job_title_array[] = array('id' => $job_title_values['job_title_id'], 'text' => $job_title_values['job_title_name']); } if (count($job_title_array) > 0) { echo tep_draw_pull_down_menu('job_title', $job_title_array); } else { echo tep_draw_input_field('job_title'); } if (tep_not_null(ENTRY_JOB_TITLE_TEXT)) echo ' <span class="inputRequirement">' . ENTRY_JOB_TITLE_TEXT; ?></td> </tr> <...> Edited January 19, 2009 by DuFF1 Quote Link to comment Share on other sites More sharing options...
roya.k Posted January 19, 2009 Share Posted January 19, 2009 Replace $job_title_array[] = array('id' => $job_title_values['job_title_id'], 'text' => $job_title_values['job_title_name']); With: $job_title_array[] = array('id' => $job_title_values['job_title_name'], 'text' => $job_title_values['job_title_name']); Quote Open source n'est pas un échange à sens unique ... La plupart du temps un simple merci ou quelques mots d'encouragement suffisent... 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.