Results 1 to 5 of 5
  1. #1
    Join Date
    Jan 2007
    Posts
    50
    Plugin Contributions
    0

    Default Registration Form Drop Down Check?

    I have an added dropdown menu on the registration form and I have tried to mirror it as best as I can to how the country's dropdown menu is done....

    The country dropdown has this check:
    PHP Code:
    if ( (is_numeric($country) == false) || ($country 1) ) {
        
    $error true;
        
    $messageStack->add('create_account'ENTRY_COUNTRY_ERROR);
      } 
    now when I try the same thing with my dropdown menu, it always gives me an error even when a value is selected??

    my dropdown values are getting filled the same way as country is:

    PHP Code:
    //COUNTRY DROP DOWN
    function zen_get_country_list($name$selected ''$parameters '') {
        
    $countries_array = array(array('id' => '''text' => PULL_DOWN_DEFAULT));
        
    $countries zen_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 
    zen_draw_pull_down_menu($name$countries_array$selected$parameters);
      }
      
      
    //MY DROP DOWN
      
    function zen_get_residence_list($name$selected ''$parameters '') {
        
        
    $residence_array = array(array('id' => '''text' => PULL_DOWN_HALL));
        
    $rarray zen_get_halls();
        for (
    $i=0$n=sizeof($rarray); $i<$n$i++) {
          
    $residence_array[] = array('id' => $rarray[$i], 'text' => $rarray[$i]);
        }

        return 
    zen_draw_pull_down_menu($name$residence_array$selected$parameters);
      } 
    Has anybody else dealt with checking drop downs? What am I doing wrong?

  2. #2
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,761
    Plugin Contributions
    9

    Default Re: Registration Form Drop Down Check?

    I am assuming that this is a tpl file....

    There are basically 2 files one that retreives data and one that displays the data.

    Apperently the array that is created by the other file is not pulling/creating the array. So you have to generate this to be able to display it.

    Start with includes/modules/create_account.php
    Zen-Venom Get Bitten

  3. #3
    Join Date
    Jan 2007
    Posts
    50
    Plugin Contributions
    0

    Default Re: Registration Form Drop Down Check?

    The dropdown function that I am calling is in html_output.php and is getting called in tpl_modules_create_account.

    it is creating the array and displaying the values in the drop down on the form how it should, the problem is the checking function that I showed in the previous post (create_account.php) is not working for my dropdown, (it gives displays the error that I havent selected a value, even when I have selected one).

  4. #4
    Join Date
    Jan 2007
    Posts
    50
    Plugin Contributions
    0

    Default Re: Registration Form Drop Down Check?

    I solved the problem by doing the check this way:
    PHP Code:
    if (isset($_POST['residence_hall']) && $_POST['residence_hall'] == '') { 
    That works the way it should.

  5. #5
    Join Date
    Aug 2004
    Posts
    1,590
    Plugin Contributions
    1

    Default Re: Registration Form Drop Down Check?

    You could also use:

    PHP Code:
    if (isset($_POST['residence_hall']) && $_POST['residence_hall'] == '') { 
    as:

    PHP Code:
    if (isset($_POST['residence_hall']) && zen_not_null($_POST['residence_hall'])) { 

 

 

Similar Threads

  1. New drop down for registration
    By jojo_cool in forum All Other Contributions/Addons
    Replies: 3
    Last Post: 15 Oct 2011, 06:29 AM
  2. Can ZONES drop down during user registration?
    By kristy in forum General Questions
    Replies: 3
    Last Post: 18 Aug 2011, 05:57 AM
  3. Drill down search on drop down form
    By DaMixa in forum Templates, Stylesheets, Page Layout
    Replies: 5
    Last Post: 3 Jul 2011, 09:01 AM
  4. can " “date of Birth” field in the registration form to be three drop down boxes "???
    By lastpirate007 in forum Templates, Stylesheets, Page Layout
    Replies: 9
    Last Post: 24 Jul 2008, 12:46 AM
  5. Check boxes instead of drop-down?
    By spydercanopus in forum Setting Up Categories, Products, Attributes
    Replies: 0
    Last Post: 10 Jul 2007, 06:40 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR