Link to home
Create AccountLog in
Avatar of derrida
derrida

asked on

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
Avatar of Ryan Chong
Ryan Chong
Flag of Singapore image

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
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...


Avatar of derrida
derrida

ASKER

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
ASKER CERTIFIED SOLUTION
Avatar of Ryan Chong
Ryan Chong
Flag of Singapore image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
Avatar of derrida

ASKER

hi

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



ron
Glad could make helps here, cheers