Lists, Buttons and Textboxes

This is a discussion on "Lists, Buttons and Textboxes" within the Web Page Design section. This forum, and the thread "Lists, Buttons and Textboxes are both part of the Design Your Website category.



Go Back   Webforumz.com > Main Forums > Design Your Website > Web Page Design

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Mar 29th, 2006, 07:41
New Member
Join Date: Mar 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Lists, Buttons and Textboxes

Hi, need help for the following.

I'm currently using the HTML facility in Front Page 2003 to create a page that would enable me to select an area in England using a drop down list, then by pressing a submit button, a value would appear in the textbox. (eg. if I selected London from the drop down list and pressed 'Submit', LON would appear in the textbox') How would I go about doing this?


Below is the current HTML code on the page

HTML: Select all
<html>
<head>
<meta http-equiv="Content-Language" content="en-gb">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>TAKE PART</title>
</head>
<body bgcolor="#CCCCCC">
<p><font face="Gill Sans MT" size="2">SELECT AREA </font></p>
 
<form method="POST" action="--WEBBOT-SELF--">
<!--webbot bot="SaveResults" U-File="fpweb:///_private/form_results.csv" S-Format="TEXT/CSV" S-Label-Fields="TRUE" -->
<p><select size="1" name="D1">
<option value="LON">London</option>
<option value="MAN">Manchester</option>
<option value="LIV">Liverpool</option>
<option value="BIR">Birmingham</option>
</select><input type="submit" value="Submit" name="B1">
<input type="text" name="T1" size="20"></p>
 
</form>

Last edited by callamac; Mar 29th, 2006 at 07:51.
Reply With Quote

  #2 (permalink)  
Old Mar 29th, 2006, 14:13
Most Reputable Member
Join Date: Aug 2005
Location: North Wales, United Kingdom
Age: 21
Posts: 1,093
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to sypher
Re: Lists, Buttons and Textboxes

Lets call your page choose_location.php
Code: Select all
<?php if (isset($_POST['Submit'])) {
$D1=$_POST['D1']
}
?>
<form method="POST" action="choose_location.php">
<p><select size="1" name="D1">
<option value="London">London</option>
<option value="Manchester">Manchester</option>
<option value="Liverpool">Liverpool</option>
<option value="Birmingham">Birmingham</option>
</select><input type="submit" value="Submit" name="B1">
<input type="text" name="T1" size="20" value="<?php echo $D1;?>></p>
</form>
This will make it so when you select the country you want in the drop down, press submit it will then put the choice in the text box.

I dunno what you wanna do with this information.
Reply With Quote
  #3 (permalink)  
Old Mar 29th, 2006, 18:05
Highly Reputable Member
Join Date: May 2005
Location: U.K
Age: 21
Posts: 739
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to benbramz
Re: Lists, Buttons and Textboxes

i think your wanting this done as javascript? but why? give a bit more info plz
Reply With Quote
  #4 (permalink)  
Old Apr 6th, 2006, 08:40
New Member
Join Date: Mar 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Lists, Buttons and Textboxes

Hi again,

On one page I need people to select the name of a town from a drop down list. Where the textbox comes in is that I need the town they select from the list to be displayed in the textbox as a three letter phrase, e.g., London becomes LON. They then take that information from the screen to use elsewhere, (in this case to text using a mobile phone)

It doesn't have to be HTML, it can be javascript or anything. I just need to get it onto a webpage. I created it in early of Visual Basic using a hidden list and the following code:

Code: Select all
 
Private Sub CommandButton1_Click()
 
TextBox1.Text = ListBox2.List(ListBox1.ListIndex)
 
End Sub
 
 
Private Sub UserForm_Activate()
 
ListBox1.ListIndex = -1
ListBox1.AddItem ("Liverpool")
ListBox1.AddItem ("Manchester")
 
ListBox2.ListIndex = -1
ListBox2.AddItem ("LIV")
ListBox2.AddItem ("MAN")
End Sub
But how would I do something similar in HTML/Javascript?
Reply With Quote
  #5 (permalink)  
Old Apr 6th, 2006, 13:39
Most Reputable Member
Join Date: Aug 2005
Location: North Wales, United Kingdom
Age: 21
Posts: 1,093
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to sypher
Re: Lists, Buttons and Textboxes

Then you should of posted in the javascript forum.
Reply With Quote
Reply

Tags
lists, buttons, textboxes

Thread Tools

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
Binding Textboxes RubyRue ASP.NET Forum 2 Feb 21st, 2008 17:51
Using listeners with dynamic textBoxes DrGonzo Flash & Multimedia Forum 0 Aug 8th, 2007 10:24
help with fwd/backwrd buttons affecting other buttons typeofdoug Flash & Multimedia Forum 5 Feb 4th, 2007 03:48
writing a function to verify data inputted in textboxes jayaime JavaScript Forum 2 Jul 4th, 2006 03:29
autofill textboxes hamboy Web Page Design 3 Feb 14th, 2006 19:42


All times are GMT. The time now is 23:38.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

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