Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Web Programming > HTML > HTML Code Clinic
|
HTML Code Clinic Do you have some HTML code you'd like to share and get suggestions from others for tweaking or improving it? This discussion is the place.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the HTML Code Clinic section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 1st, 2006, 05:12 PM
Registered User
 
Join Date: Nov 2006
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default !!HELP!! Value From Listbox

I really feel like a idiot with all you clever people but I have to ask this.I need to get the text for the selected object in a select listbox. I have been trying to figure it out for a hole day now and really need help. Here is a example of what i think it should look like.

sub
dim a

a = Form.Select_name.Object_Value.text

document.write(a)
end sub


Please help ASAP. Im writing a invoice program for a pizza business
and Im used to Visual Basic so if it can be in VBScript I would be very great full


 
Old November 7th, 2006, 01:33 AM
Friend of Wrox
 
Join Date: Oct 2004
Posts: 553
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via MSN to vinod_yadav1919 Send a message via Yahoo to vinod_yadav1919
Default

HIi quentinuys!!

<script language="vbscript">
sub changeit1()
msgbox(document.myform.listbox.options(document.my form.listbox.selectedIndex).value)
msgbox(document.myform.listbox.options(document.my form.listbox.selectedIndex).text)
end sub
</script>
<form name="myform">
<input type=button value=check onclick="vbscript:changeit1()">
<select name=listbox>
<option value=Value1>Piza A</option>
<option value=Value2>Piza B</option>
<option value=Value3>Piza C</option>
<option value=Value4>Piza D</option>
</select>
</form>

Hope this will help you

Cheers :)

vinod





Similar Threads
Thread Thread Starter Forum Replies Last Post
ListBox obrienkev C# 2005 4 November 6th, 2007 03:15 AM
multiple Listbox values in another listbox terryv Excel VBA 0 June 27th, 2007 07:01 AM
ListBox kanoorani Beginning VB 6 4 September 12th, 2006 12:28 PM
About listbox csc820203 C# 1 April 29th, 2004 06:17 AM
I'm back :) Listbox var from listbox MichaelTJ .NET Web Services 2 October 21st, 2003 07:06 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.