HTML Tutorial


 /help/HTML Help Forum   FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
RegisterRegister - Not registered yet? Got something to say? Join HTML Code Tutorial!
Help w/ drop-down list made more simple
Post new topic   Reply to topic    HTML Help Forum -> PHP
View previous topic :: View next topic  
Author Message
agilstrap



Joined: 09 Jan 2009
Posts: 3

PostPosted: Sun Jan 11, 2009 11:13 pm     Help w/ drop-down list made more simple Reply with quote

I posted a topic a few days ago but no one responded. I have taken another stab at reducing the old code and adding a standard drop-down list but the list is only populating with 1 result and the one result doesn't submit the actual id to the submit function. Can someone please look at the original piece of code below and my attempt at the drop down list and offer any suggestions? Thanks...


Current multi-select code:


$iteration =0;
$skills = $skillChapter['Skill'];
foreach ($skills as $skill)
{
$skillid = $skill['id'];
$skillIds[] = array("skill".$skill['id'],$skill['title'],$skillChapter['SkillChapter']['title']);
echo "<div class=\"skillRow\">";
echo "<input type=\"checkbox\" name=\"data[Job][skill".$skillid."]\" value=\"1\" id=\"skill".$skillid."\"> ";
echo "<label for=\"skill".$skillid."\">{$skill['title']}</label>";
echo "</div>";
}
echo "</div>";
$iteration++;
echo "</div>";




My attempt to convert to a standard (single select) drop-down list. Below code is not working:




echo "<div class=\"floatClear\">";
echo $form->input( 'data[Job][skill".$skillid."]', array( 'label' => 'Select a Function', 'type'=>'select', 'options'=>
array("$skill".$skill['id'])));
echo "</div>";
kanenas



Joined: 14 Dec 2004
Posts: 341

PostPosted: Thu Jan 15, 2009 1:28 am     Reply with quote

What's the definition of method input? Without that information, we have no way of evaluating your problem.
fazlionline



Joined: 29 Jan 2009
Posts: 11

PostPosted: Sun Feb 08, 2009 1:06 am     Reply with quote

simple HTML will do it better then PHP.
as i undersand you question
try to see this post

http://www.htmlcodetutorial.com/help/ftopic13698-0-0-asc-.html

and its code is this

<form name="form1">
<select name="favs1" onChange="window.open(this.options[this.selectedIndex].value)">
<option selected>Favourites</option>
<option>-------------------</option>
<option value="http://www.yahoo.com">Yahoo!</option>
<option value="http://www.altavista.com">Altavista</option>
</select>
</form>
Display posts from previous:   
Post new topic   Reply to topic    HTML Help Forum -> PHP All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
HTML Help Archive
Powered by phpBB © 2001, 2005 phpBB Group
HTML Help topic RSS feed 

 
DARFUR
HOSTING / DESIGN
MAKE MONEY

Home
  |   Tutorials   |   Forum   |   Quick List   |   Link Directory   |   About
Copyright ©1997-2002 Idocs and ©2002-2007 HTML Code Tutorial