Go Back   Webmaster Malaysia Forum » Website Design & Development » Website Design

Reply
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 21-08-2002, 10:49 AM
kala_krayon's Avatar
New kid on the block
 
Join Date: Jul 2002
Posts: 9
Rep Power: 0
kala_krayon is on a distinguished road
Lightbulb Add option value for List/Menu box

Hi, need some help pls

I have 1 List/Menu box(myList) 1 button (AddList) and 1 button (Remove) . My button will enable the user to add/remove the list from list/menu box. The 'Remove' button is ok but i can't figure out how to make the 'AddList' button working..

My Code:
--the function
PHP Code:
<script language=javascript>
function 
AddNewList()
{
strValue="data1"
strList="<option>" strValue "</option>";
}
</script> 
--the form
PHP Code:
<select id=myList name=myList form=theform size=>
         <
script language=vbscript>
         
AddNewList()
         
document.write strList 
         </script>
</select>
<input type=button name=Remove value="Remove"
onclick="javascript:theform.myList.remove(theform.myList.selectedindex);">

<input type=button name=AddList value="AddList" onclick="AddNewList()"> 
any Hint???
thanks in advanced.

Last edited by kala_krayon; 22-08-2002 at 01:21 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 27-08-2002, 11:16 PM
kpyew's Avatar
Senior Webmaster
 
Join Date: Jul 2001
Location: KL, Malaysia
Posts: 277
Rep Power: 93
kpyew is on a distinguished road
Send a message via ICQ to kpyew
Are you looking for something like this?

PHP Code:
<html>
<
script language=javascript>
    function 
add() {
        
frm.s.add(new Option(frm.new_value.valuefrm.new_value.value));
    }
    
    function 
remove() {
        
frm.s.remove(frm.s.selectedIndex);
    }
</script>

    <br><br>

    <form name=frm>
        <select name=s>
        <option>Please select...</option>
        </select>

        <br><br>
        <input type=button value=" Add " onclick="add();"> New Option Value <input type=text name=new_value><br>
        <input type=button value=" Remove " onclick="remove();">
    </form>
</html> 
__________________
webmaster @ http://kongtechnology.com
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 29-08-2002, 06:38 PM
kala_krayon's Avatar
New kid on the block
 
Join Date: Jul 2002
Posts: 9
Rep Power: 0
kala_krayon is on a distinguished road
TQ

yaa sort of... anyway thanks.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Menu Effect: Webmastermalaysia. cleoz Website Design 3 29-04-2007 12:05 PM
list down menu... prinses Website Programming 8 10-09-2004 07:20 AM
Popup menu problem jhanwt Website Design 2 26-05-2004 08:23 PM
Plus-minus menu dwazni Website Design 3 07-06-2002 09:36 PM
Hierarcy menu in dw maman Webmaster Tools 4 01-05-2002 07:30 PM



All times are GMT +8. The time now is 04:28 AM. Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO 3.1.0 vBulletin skin by ForumMonkeys.com.


WebmasterMalaysia.com is Proudly Hosted by Exabytes Semi Dedicated Server.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59