relations between form fields

hi

i created a simple form in an html page. now i was asked to do that when the user select a product the right price will appear in the price field. how and can i do it in dreamweaver?


best regards

ron
LVL 1
derridaAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Ryan ChongCommented:
something like this?

<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body>
<form name="form1" method="post" action="">
  <p>
    <select name="product" id="product" onChange="document.getElementById('price').innerHTML = this.value; ">
      <option value=" "></option>
      <option value="10.00">Product 1</option>
      <option value="5.88">Product 2</option>
      <option value="6.99">Product 3</option>
      <option value="11.50">Product 4</option>
    </select>
  </p>
  Price: <span id="price"></span>
  <p>&nbsp;</p>
</form>
</body>
</html>



hope this helps
0
RineauCommented:
Could you be more specific?

For example if you have images representing your products and you have a textfield to show the products price, you can add normal behaviours to the product images.

1) Select the appropriate image
2) Go to "Behaviours" panel and select "Set Text"
3) Then select "Set text of text field" and select the text field you want the price to appear in and type the price in the dialog box
4) Change the action to whatever you want. E.g. "onMouseOver" and there you are...


0
derridaAuthor Commented:
hi
thanks for your answers.
i have the products in a jump menu. then when the user will choose one product i want the price of that product to appear in the price textfield.

i hope this specification will help.

the first response is pretty close i will work on the basis of it. but i will be thankfull for more answers.


best regards

ron
0
Cloud Class® Course: Certified Penetration Testing

This CPTE Certified Penetration Testing Engineer course covers everything you need to know about becoming a Certified Penetration Testing Engineer. Career Path: Professional roles include Ethical Hackers, Security Consultants, System Administrators, and Chief Security Officers.

Ryan ChongCommented:
if Price is a text field, you can try this instead:

<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body>
<form name="form1" method="post" action="">
  <p>
    <select name="product" id="product" onChange="document.forms[0].price.value = this.value; ">
      <option value=" "></option>
      <option value="10.00">Product 1</option>
      <option value="5.88">Product 2</option>
      <option value="6.99">Product 3</option>
      <option value="11.50">Product 4</option>
    </select>
  </p>
  Price:
  <input name="price" type="text" id="price">
  </span>
  <p>&nbsp;</p>
</form>
</body>
</html>
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
derridaAuthor Commented:
hi

thanks it works perfectly . you are a life saver:)



ron
0
Ryan ChongCommented:
Glad could make helps here, cheers
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Adobe Dreamweaver

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.