Option values

This is a discussion on "Option values" within the JavaScript Forum section. This forum, and the thread "Option values are both part of the Program Your Website category.



Go Back   Webforumz.com > Main Forums > Program Your Website > JavaScript Forum

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Jul 5th, 2007, 14:27
New Member
Join Date: Jul 2007
Location: somewhere in this world
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Option values

Below is a option and a text box , well basicly what i wanted to do is whenever the user chooses a option , the value would be shown on the text box

Wanted output :

option = Women suit
text box = 4

Hope you guys could help me out.
Thanx in advance

/*
<td width="128"><select size="1" name="cboItem1">
<option selected>None</option>
<option value="4">Women Suit</option>
</select></td>

<td width="71"><input type="text" name="txtItem1UnitPrice" size="7" value="0.00"></td>
*/
Reply With Quote

  #2 (permalink)  
Old Jul 5th, 2007, 17:41
c010depunkk's Avatar
SuperMember

SuperMember
Join Date: Apr 2007
Location: Willich, Germany
Age: 20
Posts: 593
Blog Entries: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to c010depunkk
Re: Option values

When should the selected option be displayed? On the next page-load? Or instantly? Do you want to use php or javascript or what?

I'm not sure how to do it with javascript but with PHP it works like this:

PHP: Select all

<html>
<head>
 <title>get posted option</title>
</head>
<body>
 <form>
  <select size="1" name="cboItem1">
    <option selected>None</option>
    <option value="4">Women Suit</option>
  </select>
  <input type="text" value="<?php if(isset($_POST['cboItem1'])) { echo($_POST['cboItem1']); } ?>" />
 </form>
</body>
Reply With Quote
  #3 (permalink)  
Old Jul 5th, 2007, 18:48
New Member
Join Date: Jun 2007
Location: England
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Option values

Quote:
Originally Posted by AdINo View Post
Below is a option and a text box , well basicly what i wanted to do is whenever the user chooses a option , the value would be shown on the text box

Wanted output :

option = Women suit
text box = 4
I think this does what you're asking.
Reply With Quote
Reply

Tags
forms, input, values

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
Option values AdINo Web Page Design 3 Jul 6th, 2007 10:09
How to put bookmark option in my website lekha Starting Out 1 May 12th, 2007 11:47
Setting Form Values to Previously Entered Values masonbarge PHP Forum 6 Oct 17th, 2006 17:36
Assign string values to integer values of a session variable Andy K Classic ASP 1 Jul 13th, 2005 08:29
I need help with the Select Option..... courtjester JavaScript Forum 6 Nov 19th, 2003 14:34


All times are GMT. The time now is 04:54.


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