Last post May 14, 2018 05:28 PM by vahid bakkhi
Member
17 Points
60 Posts
May 14, 2018 04:40 PM|Kati Ais|LINK
Hi,
I have an input and I want to test before I make an attribute, this is what I did:
<input type="email" class="form-control" id="groupe" @(myClass.att == "" ? placeholder="placeholder" :value="a value")>
But it's not working for me, any help please?
Thanks in advence,
Star
8069 Points
2780 Posts
May 14, 2018 05:19 PM|vahid bakkhi|LINK
hi
please try below code :
@if (myClass.att == "") { <input type="email" class="form-control" id="groupe" placeholder = "placeholder" > } else { <input type="email" class="form-control" id="groupe" value = "a value"> }
May 14, 2018 05:27 PM|Kati Ais|LINK
Yes it's work thank you so much
May 14, 2018 05:28 PM|vahid bakkhi|LINK
also you can try this
<input type="email" class="form-control" id="groupe" placeholder="@(myClass.att == "" ? "placeholder":"")" value="@(myClass.att == "" ? "":"a value")" />
Member
17 Points
60 Posts
add an conditional attribute
May 14, 2018 04:40 PM|Kati Ais|LINK
Hi,
I have an input and I want to test before I make an attribute, this is what I did:
But it's not working for me, any help please?
Thanks in advence,
Star
8069 Points
2780 Posts
Re: add an conditional attribute
May 14, 2018 05:19 PM|vahid bakkhi|LINK
hi
please try below code :
Please MARK AS ANSWER if suggestion helps.
Member
17 Points
60 Posts
Re: add an conditional attribute
May 14, 2018 05:27 PM|Kati Ais|LINK
Yes it's work thank you so much
Star
8069 Points
2780 Posts
Re: add an conditional attribute
May 14, 2018 05:28 PM|vahid bakkhi|LINK
also you can try this
Please MARK AS ANSWER if suggestion helps.