Alex's Support Forums » Resources

Simple User Trick - Adding Dropdown field values

(1 post)
  • Started 4 months ago by nortongulch

  1. nortongulch
    Member

    User wanted drop down list of How Found choices:

    In sc_admin/include/contact/build.php
    find $foundby input area -- Change <input type="text" name="foundby" ... to
    <select type="text" name"foundby" ...
    Then add
    <option selected>Please Select!
    <option>Yellow Pages
    <option>Previous customer
    <option>Friend sent me
    <option>LA Times
    <option>Whatever....
    </select>

    just before the error handling for the field:
    <?php if (isset($err_foundby)) { printf("<p>%s</p>",$err_foundby); } ?>

    If field is required, modify sc_admin/include/contact/posted.php
    to address invalid default value of "Please Select!"

    Just after:
    $foundby = sql_quote($_POST['foundby']);
    add:
    if ($foundby == "Please Select!") {$foundby = "";}

    Posted 4 months ago #

RSS feed for this topic

Reply

You must log in to post.