value incomplete in form

4 views
Skip to first unread message

TX

unread,
Sep 26, 2016, 3:44:14 AM9/26/16
to erlydtl-users
Hi all,

If I display a value not in form, it is always displayed properly, for example:

if address = "No. 20, Test Street".
Address: {{ address }}

will display

Address:
No. 20, Test Street

However, if I put it in a form in foundation 6, like below:

<input type="text" name="address" {% if address %}value={{ address }}{% endif %}>

Then there is only No. in the input box, everthing after the first space is not displayed.

Did anyone know how to solve this problem and make it fully displayed?

Thank you.

Nuku Ameyibor

unread,
Sep 26, 2016, 8:18:47 AM9/26/16
to erlydt...@googlegroups.com
Dear Tx ,


<input type="text" name="address" {% if address %}value={{ address }}{% endif %}>

value={{ address }} i am guessing should be
value="{{ address }}"
you also left out a closing tag and the html may be generating an error


<input type="text" name="address" {% if address %}value="{{ address }}"{% endif %} />
or a different variant below
  <input type="text" name="address" id="address"  value="{{ address|default:""}}" />     
the default filter will append a value if variable is false or empty .


--
You received this message because you are subscribed to the Google Groups "ErlyDTL Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to erlydtl-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

TX

unread,
Sep 26, 2016, 7:18:11 PM9/26/16
to erlydtl-users
Hi Nuku,

Thanks, yes, it should be "{{ address }}".

As for the closing tag, there is no error generated without it.

Thanks again.

------------------ 原始邮件 ------------------
发件人: "Nuku Ameyibor";<nay...@gmail.com>;
发送时间: 2016年9月26日(星期一) 晚上8:18
收件人: "erlydtl-users"<erlydt...@googlegroups.com>;
主题: Re: value incomplete in form
To unsubscribe from this group and stop receiving emails from it, send an email to erlydtl-user...@googlegroups.com.

Nuku Ameyibor

unread,
Sep 26, 2016, 10:58:43 PM9/26/16
to erlydt...@googlegroups.com
Cool stuff . 👍

From: TX
Sent: ‎9/‎26/‎2016 11:18 PM
To: erlydtl-users
Subject: 回复: value incomplete in form

Reply all
Reply to author
Forward
0 new messages