dcsimg
www.webdeveloper.com
Results 1 to 3 of 3

Thread: Modifying Select Values using PHP Arrays

Hybrid View

  1. #1
    Join Date
    Aug 2012
    Posts
    4

    Modifying Select Values using PHP Arrays

    I am currently building my select box data with the following code that uses arrays extracted from mysql.

    <select name="country">
    <? foreach ($countrys as $country): ?>
    <option value="<? htmlout($country['id']); ?>"><b><? htmlout($country['name']); ?>
    </option>
    <? endforeach; ?>
    </select>

    Now I also have two vars called $states and $provinces which I would like to use to populate another select box based on the country selection (USA or Canada)

    I'm told javascript can do this easily but Is it possible to use javascript even though the data is stored in PHP variables?

  2. #2
    Join Date
    Jun 2008
    Location
    Europe
    Posts
    1,114

  3. #3
    Join Date
    Aug 2012
    Posts
    4
    Thank you very much.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles