我正在尝试重新创建位于此处的表单:http://yeticustomshop.com/get-quote(请查看此内容以供参考)
需要的用户体验:
// Get all the product radio buttons and loop them
var products = document.getElementsByName('product');
for (var i = products.length; i--;) {
// add an event listener to do stuff when one of them is clicked
products[i].addEventListener("click", function() {
// get the value of the clicked button
var cup = this.value;
// put the value in the input box
document.getElementById('yourSelection').value = cup;
// hide the radio buttons and show the table
document.getElementById("cupDesc").style.display = "block";
document.getElementById("addProductBtn").style.display = "block";
document.getElementById("cupSelect").style.display = "none";
});
}
Here's my previous post on here
附注:此过程正在表单中使用。我想知道是否有可能更容易让它像购物车一样。我已经下载了simplecart.js,但Javascript不是我的强项。请帮忙。