Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Web Programming > JavaScript > Javascript How-To
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Javascript How-To Ask your "How do I do this with Javascript?" questions here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript How-To section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old June 4th, 2003, 10:59 PM
Authorized User
 
Join Date: Jun 2003
Location: Quezon City, NCR, Philippines.
Posts: 26
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to vickriz
Default dynamic select item?

Good day to all.
how can i make a select item on[list] option form. end then at the next [input] box it will show the groupname of items where it belong.

ex.
municipality underProvince
Tondo CapitalRegion
Makati MetroManila
Manila CapitalRegion
Isabela Negros Occidental
Caloocan CapitalRegion
Pasay MetroManila
Alaminos Pangasinan
Alcala Pangasinan
...

listbox = municity and the inputbox = underProvince

any one can help me how to make a javascript for this prob???




Mabuhay!!!
__________________
Mabuhay!!!
Reply With Quote
  #2 (permalink)  
Old June 9th, 2003, 09:29 AM
Authorized User
 
Join Date: Jun 2003
Location: Lexington, KY, USA.
Posts: 46
Thanks: 0
Thanked 1 Time in 1 Post
Default

I will focus on how to get the select item's value into the input box.

If you need help setting up the select list, I will leave that to someone else.

<select id="place" onchange="lfNewItem(this)">
<option value="CapitalRegion">Tondo</option>
<option value="MetroManila">Makati</option>
...
</select>

<input type="text" id="groupname"/>
<script language="javascript">
<!--
function lfNewItem(pSel)
{
var lvgn=document.getElementById('groupname');
lvgn.value=this.value;
}
//-->
</script>

I think this will copy the selected item's value (the group-name) to the text box.


-Van
(Old dog learning new tricks...)
Reply With Quote
  #3 (permalink)  
Old June 10th, 2003, 08:32 AM
Authorized User
 
Join Date: Jun 2003
Location: Lexington, KY, USA.
Posts: 46
Thanks: 0
Thanked 1 Time in 1 Post
Default

Just need to correct something in the previous post...

function lfNewItem(pSel)
{
var lvgn=document.getElementById('groupname');
lvgn.value=pSel.value;
}


-Van
(Old dog learning new tricks...)
Reply With Quote
  #4 (permalink)  
Old June 11th, 2003, 09:47 PM
Authorized User
 
Join Date: Jun 2003
Location: Quezon City, NCR, Philippines.
Posts: 26
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to vickriz
Default

Thanks. the code really works...
More power!!:)

Mabuhay!!!
Reply With Quote
Reply


Thread Tools
Display Modes

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 Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I select an ITEM from a combobox? Ron Howerton VB.NET 2002/2003 Basics 18 October 2nd, 2015 09:18 PM
how to select an item from listview jthadathilm16 VB How-To 1 April 24th, 2006 11:33 AM
Dynamic Checkboxes using dynamic Select Values bsheridan Classic ASP Databases 0 March 12th, 2006 09:17 AM
Select an particular item when a listbox opens? alastair Access 2 December 29th, 2005 05:04 PM
dynamic select item? vickriz Javascript 1 June 5th, 2003 03:21 PM



All times are GMT -4. The time now is 08:41 AM.


Powered by vBulletin®
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.