Welcome to Dream.In.Code
Getting PHP Help is Easy!

Join 132,676 PHP Programmers for FREE! Get instant access to thousands of PHP experts, tutorials, code snippets, and more! There are 1,198 people online right now. Registration is fast and FREE... Join Now!




Change selectbox to as radio

 
Reply to this topicStart new topic

Change selectbox to as radio, This function is to display selected value from database in "sele

angela5
post 22 Jun, 2007 - 11:52 PM
Post #1


New D.I.C Head

*
Joined: 12 Jun, 2007
Posts: 5


My Contributions


This function is to display selected value from database in "selectbox".

CODE
function vector2options($show_vector,$selected_map_val="",$exclusion_vector=array(),$tabs="") {
    $myreturn='';
    while (list($k,$v)=each($show_vector)) {
        if (!in_array($k,$exclusion_vector)) {
            $myreturn.="$tabs<option value=\"".$k."\"";
            if ((!is_array($selected_map_val) && $k==$selected_map_val) || (is_array($selected_map_val) && in_array($k,$selected_map_val))) {
                $myreturn.=" selected=\"selected\"";
            }
            $myreturn.=">".$v."</option>\n";
        }
    }
    return $myreturn;
}  


Please help to change this function for "radio button" and "multiple selectbox".
Thank you very much in advance.

This post has been edited by angela5: 22 Jun, 2007 - 11:54 PM
User is offlineProfile CardPM

Go to the top of the page

snoj
post 23 Jun, 2007 - 12:21 AM
Post #2


$Null

Group Icon
Joined: 31 Mar, 2003
Posts: 3,304



Thanked 5 times

Dream Kudos: 700
My Contributions


We don't do your work for you. Radio buttons and Multiple select boxes are simple enough.
User is offlineProfile CardPM

Go to the top of the page

Fast ReplyReply to this topicStart new topic
Time is now: 11/23/08 06:28AM

Live PHP Help!

PHP Tutorials

Reference Sheets

PHP Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month