Jump to content


Photo

help changin a value


  • Please log in to reply
2 replies to this topic

#1 brown2005

brown2005
  • Members
  • PipPipPip
  • Advanced Member
  • 943 posts

Posted 05 May 2006 - 09:13 AM

Hi,

I have a form,

where i have a field

Featured and they can select yes or No.

If they select no i want a price field that says £5.00 and if they select yes i want a price field that says £10.00.

any help please?

#2 GBS

GBS
  • Members
  • PipPipPip
  • Advanced Member
  • 108 posts

Posted 05 May 2006 - 10:10 AM

Hi,,

Try maybe something like that,
<html>
<head>
<title>testing,,</title>
<style>
</style>
</head>
<body>
<script>
function ShowPrices(node)
{
var prices=node.value;
document.getElementById('price').innerHTML=prices;
document.getElementById('price').style.visibility="visible";
}
function Hideprice()
{
document.getElementById('price').style.visibility="hidden";
}
</script>

<form name="test">
Please, select an option:
<input type="radio" name="pricing" value="£5.00" onclick="ShowPrices(this);">price A
<input type="radio" name="pricing" value="£10.00" onclick="ShowPrices(this);">price B
<div id="price" style="visibility:hidden;border-color:blue;border-width: 1px;border-style: solid;width:50px;" ></div>
<br>
<input type="submit" name="Request" value="Submit">
<br><br>
<input type="reset" name="Clear" value="Clear form" onclick="Hideprice()">
</form>
</body>
</html>
example done with radio buttons, but you can transpose it using checkboxes, selectbox,...

Hoping it helps,,

l8tr,,
Sorry for my english,... I do my best, but sometimes,...
1st intention: understand the problem
2nd intention: try to solve it
3rd intention: try to understand how to solve it :)

#3 brown2005

brown2005
  • Members
  • PipPipPip
  • Advanced Member
  • 943 posts

Posted 05 May 2006 - 10:36 AM

spot on....

thats exactly what i want...

cheers





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users