Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Dropdown Menu Only Displaying First Character


Guest

Recommended Posts

Posted

I added several fields to my 'create account' form. All looks good except for my dropdown menus. I made fields for the telephone type such as "business, home, fax, etc.". The dropdown menu is only displaying and recording the first character of each variable from my array. I thought maybe my database field was set up for only 1 character, but that doesn't appear to be the issue. I'm not a programming expert; I've been learning as I go, please keep that in mind with your replies.

 

Here's the web address for the page in question: http://www.errandaces.com/create_account.php

 

Here's a sample of the code I'm using for the menu:

 

<?php
$teletype_list[0] = 'Select';
$teletype_list[1] = 'Business Main';
$teletype_list[2] = 'Business Direct';
$teletype_list[3] = 'Home';
$teletype_list[4] = 'Cell Phone';
$teletype_list[5] = 'Fax';
$teletype_list[6] = 'Other';
?>
              <td><?php echo tep_draw_pull_down_menu('teletypea', $teletype_list); ?></td>

 

Any assistance in resolving this issue or better understanding it would be much appreciated.

Posted

I really don't know if this will be any better, but it won't hurt to try:

 

<?php
 $teletype_list = array();
 $teletype_list[0] = 'Select';
 $teletype_list[1] = 'Business Main';
 $teletype_list[2] = 'Business Direct';
 $teletype_list[3] = 'Home';
 $teletype_list[4] = 'Cell Phone';
 $teletype_list[5] = 'Fax';
 $teletype_list[6] = 'Other';
?>
<td><?php echo tep_draw_pull_down_menu('teletypea', $teletype_list); ?></td>

Looking at the HTML source I can see the problem.

 

I just can't be certain this fixes it...

:blush:

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Posted
I really don't know if this will be any better, but it won't hurt to try:

 

Thanks for the try. It did not work. I had previously tried this as well (with the same failed result).

 

  $teletype_list = array('Business Main', 'Business Direct', 'Home', 'Cell Phone', 'Fax', 'Other');

Posted
<?php
 $teletype_list[] = array('id' => 'Select', 'text' => 'Select');
 $teletype_list[] = array('id' => 'Business Main', 'text' => 'Business Main');
 $teletype_list[] = array('id' => 'Business Direct', 'text' => 'Business Direct');
 $teletype_list[] = array('id' => 'Home', 'text' => 'Home');
 $teletype_list[] = array('id' => 'Cell Phone', 'text' => 'Cell Phone');
 $teletype_list[] = array('id' => 'Fax', 'text' => 'Fax');
 $teletype_list[] = array('id' => 'Other', 'text' => 'Other');
?>
<td><?php echo tep_draw_pull_down_menu('teletypea', $teletype_list); ?></td>

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Posted
<?php
 $teletype_list[] = array('id' => 'Select', 'text' => 'Select');
 $teletype_list[] = array('id' => 'Business Main', 'text' => 'Business Main');
 $teletype_list[] = array('id' => 'Business Direct', 'text' => 'Business Direct');
 $teletype_list[] = array('id' => 'Home', 'text' => 'Home');
 $teletype_list[] = array('id' => 'Cell Phone', 'text' => 'Cell Phone');
 $teletype_list[] = array('id' => 'Fax', 'text' => 'Fax');
 $teletype_list[] = array('id' => 'Other', 'text' => 'Other');
?>
<td><?php echo tep_draw_pull_down_menu('teletypea', $teletype_list); ?></td>

 

This did the trick. Thank you so much!

Archived

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

×
×
  • Create New...