我有一个网站,可以通过多种方式访问我们的“给我发电子邮件以获取更多信息”表单。在表单上,它有一个复选框列表,他们可以检查是否希望通过电子邮件收到有关更多信息的电子邮件。是否可以根据它们来自哪个页面预先选中复选框?
例如,他们访问我们的“产品 12”页面并点击表单的链接,并且有一个复选框用于接收有关产品 12 的更多信息,因为他们是从产品 12 页面进入表单的,所以该复选框已被预先选中。
这是我的表单代码:
<form id="formElem" name="formElem" action="" method="post">
<fieldset class="step">
<legend>Personal Details</legend>
<p>
<label for="fullname">Full Name</label>
<input id="fullname" name="username" />
</p>
<p>
<label for="company">Company Name</label>
<input id="company" name="company" />
</p>
<p>
<label for="title">Title</label>
<input id="title" name="title" />
</p>
<p>
<label for="phone">Phone Number</label>
<input id="phone" name="phone" />
</p>
<p>
<label for="email">Email</label>
<input id="email" name="email" placeholder="info@.com" type="email" AUTOCOMPLETE=OFF />
</p>
</fieldset>
<fieldset class="step">
<legend>Products I'm interested in...</legend>
<p>
<input type="checkbox" name="telematics" value="telematics">Telematics<br>
</p>
<p>
<input type="checkbox" name="controllers" value="controllers">Controllers<br>
</p>
<p>
<input type="checkbox" name="cots" value="cots">Custom-off-the-Shelf<br>
</p>
<p>
<input type="checkbox" name="displays" value="displays">Displays\Operator Interfaces<br>
</p>
<p>
<input type="checkbox" name="cordReels" value="cordreels">Cord Reels<br>
</p>
<p>
<input type="checkbox" name="pdm" value="pdm">Power Distribution Modules<br>
</p>
<p>
<input type="checkbox" name="rtc" value="rtc">Real Time Clock<br>
</p>
</fieldset>
<fieldset class="step">
<legend>Services I'm interested in...</legend>
<p>
<input type="checkbox" name="productDev" value="productdev">Product Development<br>
</p>
<p>
<input type="checkbox" name="desEng" value="deseng">Design Engineering<br>
</p>
<p>
<input type="checkbox" name="dfx" value="dfx">DFX<br>
</p>
<p>
<input type="checkbox" name="transServices" value="transServices">Transition Services<br>
</p>
<p>
<input type="checkbox" name="stratSourcing" value="stratSourcing">Strategic Sourcing<br>
</p>
<p>
<input type="checkbox" name="planning" value="planning">Planning<br>
</p>
<p>
<input type="checkbox" name="manufacturing" value="manufacturing">Manufacturing<br>
</p>
<p>
<input type="checkbox" name="fullfillment" value="fullfillment">Fullfillment<br>
</p>
<p>
<input type="checkbox" name="prodLifecycle" value="prodLifecycle">Product Life-Cycle Management<br>
</p>
</fieldset>
<fieldset class="step">
<legend>Confirm</legend>
<p>Everything in the form was correctly filled
if all the steps have a green checkmark icon.
A red checkmark icon indicates that some field
is missing or filled out with invalid data.
</p>
<p class="submit">
<button id="registerButton" type="submit">Register</button>
</p>
</fieldset>
</form>
服务器端代码将是 PHP。
请回复。