Jump to content

Archived

This topic is now archived and is closed to further replies.

brown2005

help changin a value

Recommended Posts

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?

Share this post


Link to post
Share on other sites
Hi,,

Try maybe something like that,
[code]
<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>
[/code]
example done with radio buttons, but you can transpose it using checkboxes, selectbox,...

Hoping it helps,,

l8tr,,

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.