shihao Posted October 20, 2009 Share Posted October 20, 2009 Hello everbody, I am php newbie. I need to develop a program that once click the drop down menu, the textarea will change the value base on the dropdown menu. I have problem changing the value of textarea. I wonder anyone could help me on this? Link to comment https://forums.phpfreaks.com/topic/178317-dropdown-menu/ Share on other sites More sharing options...
shihao Posted October 20, 2009 Author Share Posted October 20, 2009 My code is roughly like this: The drop down menu take the data from database: <select name="mycustomer" onchange="transaction_ddl()"> <?php while ($row=mysql_fetch_array($result)){?> <option value="<?echo $row['customer'];?>" <?if ($mycustomer==$row['customer']) echo "selected";?>><?echo $row['customer']?></option> <?}?> </select> I don't know how to write the textarea part which also need to take from database. <td><TEXTAREA name="address" COLS=40 ROWS=6 value="<?echo $row['address'];?>"></TEXTAREA> Link to comment https://forums.phpfreaks.com/topic/178317-dropdown-menu/#findComment-940251 Share on other sites More sharing options...
Alt_F4 Posted October 20, 2009 Share Posted October 20, 2009 what is in the transaction_ddl function?? Link to comment https://forums.phpfreaks.com/topic/178317-dropdown-menu/#findComment-940254 Share on other sites More sharing options...
Bricktop Posted October 20, 2009 Share Posted October 20, 2009 Hi shihao, Textareas do not have a "value" attribute. If you wish to populate a textarea with data, (using your example) do the following: <td><TEXTAREA name="address" COLS=40 ROWS=6><? echo $row['address']; ?></TEXTAREA> Hope this helps. Link to comment https://forums.phpfreaks.com/topic/178317-dropdown-menu/#findComment-940257 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.