Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Changing Style Of Drop Down Menu


timmaggs

Recommended Posts

On my create_accout.php page the code that I want changing it says:

 

<?php echo tep_get_country_list('country') . '' . (tep_not_null(ENTRY_COUNTRY_TEXT) ? '' . '': ''); ?>

In includes/functions/html_output.php which is where this links to I believe it says:

 

// Creates a pull-down list of countries
 function tep_get_country_list($name, $selected = '', $parameters = '') {
$countries_array = array(array('id' => '', 'text' => PULL_DOWN_DEFAULT));
$countries = tep_get_countries();

for ($i=0, $n=sizeof($countries); $i<$n; $i++) {
  $countries_array[] = array('id' => $countries[$i]['countries_id'], 'text' => $countries[$i]['countries_name']);
}

return tep_draw_pull_down_menu($name, $countries_array, $selected, $parameters);
 }
?>

Then when viewing the source of my HTML page it spits it out looking:

 

<select name="country"><option value="">Please Select</option><option value="1">Afghanistan</option><option value="2">Albania</option>

...ect. through all the countrys.

 

I have tryed many different ways but keep getting error messages, how from this can I get the code to spit out HTML in the end that says:

 

<select name="country" class="search_box"><option value="">Please Select</option><option value="1">Afghanistan</option><option value="2">Albania</option>

With class="search_box" being included. Any Ideas?

 

Thanks,

 

Tim

Link to comment
Share on other sites

Please? Anyone got an answer on this, just spent another whole day trying to work it out to no avail.

 

Tim

 

 

i would look in the "return tep_draw_pull_down_menu();" function...

 

function tep_draw_pull_down_menu($name, $values, $default = '', $parameters = '', $required = false) {

$field = '<select name="' . tep_output_string($name) . '" class="search_box"';

 

try this... its untested and may not work.

 

PS this will change the class for all dropdown menus created with this function !!

Its Only Me

Alex

Link to comment
Share on other sites

Thats worked perfectly, but now what I want to do is when a text box is created on the shopping_cart page it is created differently, so I can have it a different style off the stylesheet.

 

Is this possible?

 

Tim

Link to comment
Share on other sites

Thats worked perfectly, but now what I want to do is when a text box is created on the shopping_cart page it is created differently, so I can have it a different style off the stylesheet.

 

Is this possible?

 

Tim

 

What you want to do is change the $parameters variable. As you can see below in the function $parameters is the third argument

function tep_get_country_list($name, $selected = '', $parameters = '')

 

So when you use tep_get_country_list and you want to add a specific class to it, you add that class as the 3rd argument in $parameters..For example to add the class search_box it should be

<?php echo tep_get_country_list('country', '', 'class="search_box"' )

 

This should give you what you want..also the $parameters argument could be the 3rd or 4th argument..but i think its the 3rd

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...