我试图在URL中传递这样的变量,以填充HTML和液态表单,并在填充之后提交:
password=123456
我发现最接近我想要达到的目标是this question。我失去了我的弹珠,因为我不明白变量是如何被放入表单中的。
有人能把它拆开/解释一下吗?
以下是表单代码:
{% form 'customer_login' %}
<h1>Login</h1>
{% include 'form-errors-custom' %}
<label for="customer_email" class="hidden-label">Email Address</label>
<input type="email" value="" name="customer[email]" id="customer_email" placeholder="Email" {% if form.errors contains "email" %} class="error"{% endif %} autocorrect="off" autocapitalize="off" autofocus>
{% if form.password_needed %}
<label for="customer_password" class="hidden-label">Password</label>
<input type="password" value="" name="customer[password]" id="customer_password" placeholder="Password" {% if form.errors contains "password" %} class="error"{% endif %}>
<p>
<a href="#" onclick="showRecoverPasswordForm();return false;">Forgot your password?</a>
</p>
{% endif %}
<div class="text-center">
<p>
<input type="submit" class="btn" value="Sign In">
</p>
or <a href="{{ shop.url }}">Return to Store</a>
</div>
{% endform %}
发布于 2015-12-02 02:01:55
在url中传递的参数类似于get请求,并且可以以与method="get"一起接收表单提交的参数相同的方式接收参数。然后将变量放在当前页面中表单字段的value属性中。
https://stackoverflow.com/questions/34033572
复制相似问题