简体   繁体   中英

Auto Fill Form - From Pressed Link

I have this website: website link

When the user clicks on one of the items in the gallery, I want the image to open (in a lightbox ?). Here I want to have a link to a prefilled contact form with the item in question.

someone provided me this code to get start but it only auto fills the form. It doesn't forward to the contact form and auto fill it in.

<form>
    <input type="text" id="packageDescription">
    <input type="text" id="packagePrice">
</form>

<script>

    function autoFill(packageDescription, packagePrice) {

        document.getElementById('packageDescription').value = packageDescription;
        document.getElementById('packagePrice').value = packagePrice;

    }

</script>

<a href="#" onClick="autoFill('Premium Package', 150); return false;">Premium Package</a><br>
<a href="#" onClick="autoFill('Platinum Package', 350); return false;">Platinum Package</a>

Thanks

仅当链接本身和联系表在同一页面中找到时,提供给您的此代码才有效

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM