I'm trying to create a link that when clicked on will redirect me to another html page with a contact form, and in that form there is a subject input box.
(我正在尝试创建一个链接,单击该链接会将我重定向到带有联系表单的另一个html页面,并且在该表单中有一个主题输入框。)
Depending on which link is clicked, I want the subject box to be populated with the corresponding link title. (根据要单击的链接,我希望在主题框中填充相应的链接标题。)
Tried searching for awhile now and have no idea how to get it to work.
(尝试搜索了一段时间,却不知道如何使其工作。)
Tried playing around with the key value pairs method mentioned in some other places but definitely doing it wrong, and not sure how. (尝试使用其他地方提到的键值对方法,但肯定做错了,不确定如何做。)
Below is a snippet of my code.
(以下是我的代码片段。)
The h3 "Title of the product here" is what I want to populate the subject box with (in my actual website I will have multiple links populating the subject lines with different words). (h3“此处的产品标题”是我要填充主题框的内容(在我的实际网站中,我将有多个链接,用不同的单词填充主题行)。)
Main Page
(主页)
<div class="squareIndexContentBox1" style="background-color: #fff">
<a href="contact us.html?subject=testing">
<h3>Title of the product here</h3>
<p>
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
</p>
<div class="learn-more">
<span id="learn-more">Contact us</span>
<span class="fa fa-hand-o-left"></span>
</div>
</a>
</div>
Page where I want the input box to be filled
(我要填写输入框的页面)
<div class="contact-form">
<h2> Contact Us </h2>
<form method="POST" action="contact-form-handler.php">
<input type="text" name="name" placeholder="Name" required>
<br>
<input type="email" name="email" placeholder="Email" required>
<br>
<input id="subject" type="text" name="subject" placeholder="Subject" required>
<br>
<textarea type="text" name="message" placeholder="Message"></textarea>
<br>
<div class="g-recaptcha" data-sitekey=""></div>
<br>
<input type="submit" name="submit" class="submit-btn" value="Send Message">
</form>
</div>
Thanks in advance!
(提前致谢!)
ask by John Felix translate from so 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…