PHP + Javascript
Posted: Wed Oct 15, 2003 10:12 am
Im a bit stuck here. I am trying to get the value from a JavaScript function and place it in to the VALUE of a HIDDEN field. Does anybody know how to do this. An extract of my code is below:
<SCRIPT LANGUAGE="JavaScript">
function popItUp() {
//creating a new window and loading it with contact.html
var newWindow = open("shipping.html", "secondWindow", "width=300,height=400");
}
function ChangeItem(lens,frame,price) {
document.ProductForm.Detail1.value = lens
document.ProductForm.Detail2.value = frame
document.ProductForm.Price.value = price
document.ProductForm.BasePrice.value = price
}
</script>
</head>
<div align="center">
<form name='ProductForm' method='post' action='test2.php'>
<input type="radio" name="LenFrameID" value="16478" onClick="ChangeItem('Black Violet','Black','84.95')"
CHECKED>
<br>
<input type="radio" name="LenFrameID" value="16479" onClick="ChangeItem('Violet','Blue','88.95')">
<input type="hidden" name="BasePrice" value="HOW DO I GET VALUE OF BASEPRICE HERE">
<input type='submit' value='Continue'>
</tr>
</form>
<SCRIPT LANGUAGE="JavaScript">
function popItUp() {
//creating a new window and loading it with contact.html
var newWindow = open("shipping.html", "secondWindow", "width=300,height=400");
}
function ChangeItem(lens,frame,price) {
document.ProductForm.Detail1.value = lens
document.ProductForm.Detail2.value = frame
document.ProductForm.Price.value = price
document.ProductForm.BasePrice.value = price
}
</script>
</head>
<div align="center">
<form name='ProductForm' method='post' action='test2.php'>
<input type="radio" name="LenFrameID" value="16478" onClick="ChangeItem('Black Violet','Black','84.95')"
CHECKED>
<br>
<input type="radio" name="LenFrameID" value="16479" onClick="ChangeItem('Violet','Blue','88.95')">
<input type="hidden" name="BasePrice" value="HOW DO I GET VALUE OF BASEPRICE HERE">
<input type='submit' value='Continue'>
</tr>
</form>