profusia
Forum Replies Created
-
SOLVED.
I Googled for some examples of JavaScript and then hacked around something to make it do what I needed as follows. Seems to work nicely…<script language=”javascript” type=”text/javascript”>
// On every ‘Change’ of the drop down with the ID “preference” call the displayTextField function
document.getElementById(“preference”).addEventListener(“change”, displayTextField);
function displayTextField() {
// Get the value of the selected drop down
var Chosen = document.getElementById(“preference”).value;
if (Chosen == “Submit without feedback”) {
document.getElementById(“selectedprice”).value = “2.49”;
} else {
document.getElementById(“selectedprice”).value = “5.99”;
}
}
</script>
[text selectedprice id:selectedprice class:selectedprice "5.99"]The reason for using JavaScript instead of just using a select dropdown field with pipe characters was because the CH7 PayPal plugin I’m using will pass field data to PayPal but can’t interpret select dropdowns with pipe characters separating legends and values.
The nore I think about this the more I think I should be looking to do it in JavaScript. Would that make more sense? Still need help though as am such a noob.