Hey
I have a problem with a DW7 form where i have some radiobutton options and im trying to style my own form using the field tags, but i have run into a problem regarding the name and id of fieldoptions, there doesn't seem to be any tag that references the systemname of the field that the fieldoptions adhere to, hence i would have to hardcode the systemname into the fieldoptions, which i don't find acceptable.
I noticed a tag thats called "Field.Option.ParentSystemname" but it only returns a number (don't now what to?), not the systemname for the parent field which i would have suspected it to return.
Any way of doing this without having to hardcode form fieldoptions? Somehow in order to use fieldoptions for anything you would need the systemname of the parent which currently isn't present.
Developer forum
E-mail notifications
Forms DW7 cannot use systemname in fieldoptions
Morten Fink Eriksen
Posted on 16/01/2013 15:10:29
Replies
Nicolai Høeg Pedersen
Posted on 16/01/2013 16:05:08
Could you please submit your template?
Morten Fink Eriksen
Posted on 17/01/2013 08:33:55
Here is my template.<div class="form"> <!--@Form.Start--> <!--@Form.Hidden--> <!--@LoopStart(Form.Fields)--> <div class="listitem<!--@Form.Fields.LoopMod2--> clearfix"> <!--@If(Field.Type=="Radio")--> <fieldset data-role="controlgroup"> <legend><!--@Field.Label--></legend> <!--@LoopStart(FieldOptions)--> <label for="<!--@Field.Option.ParentSystemname-->_<!--@FieldOptions.LoopCounter-->" class="left"> <!--@Field.Option.Text--> </label> <input type="radio" name="<!--@Field.Option.ParentSystemname-->" id="<!--@Field.Option.ParentSystemname-->_<!--@FieldOptions.LoopCounter-->" value="<!--@Field.Option.Value-->" /> <!--@LoopEnd(FieldOptions)--> </fieldset> <!--@EndIf--> <!--@If(Field.Type!="Radio")--> <label for="<!--@Field.Systemname-->" class="left <!--@If Defined(Field.Required)-->required<!--@EndIf(Field.Required)--> <!--@Field.ValidationValue-->"> <!--@Field.Label--><!--@If Defined(Field.Required)--> *<!--@EndIf(Field.Required)--> </label> <!--@Field.Control--> <!--@EndIf--> <!--@If Defined(Field.Description)--><span class="description"><!--@Field.Description--></span><!--@EndIf(Field.Description)--> </div> <!--@LoopEnd(Form.Fields)--> <!--@Form.Button.Submit--> <!--@Form.Button.Reset--> <!--@Form.End--> </div>
Morten Fink Eriksen
Posted on 23/01/2013 11:07:23
Been a while since i've heard something, anything new in relation to this?
Morten Bengtson
Posted on 29/01/2013 21:51:13
In Dynamicweb 8.2.1.0 you are able to use tag values of the parent context (Field) inside a loop (FieldOptions) by using the new Parent tag., like this:
<!--@Form.Start--> <!--@Form.Hidden--> <!--@LoopStart(Form.Fields)--> <div class="listitem<!--@Form.Fields.LoopMod2--> clearfix"> <!--@If(Field.Type=="Radio")--> <fieldset data-role="controlgroup"> <legend> <!--@Field.Label--> </legend> <!--@LoopStart(FieldOptions)--> <label for="<!--@Parent(Field.Systemname)-->_<!--@FieldOptions.LoopCounter-->" class="left"> <!--@Field.Option.Text--> </label> <input type="radio" name="<!--@Parent(Field.Systemname)-->" id="<!--@Parent(Field.Systemname)-->_<!--@FieldOptions.LoopCounter-->" value="<!--@Field.Option.Value-->" /> <!--@LoopEnd(FieldOptions)--> </fieldset> <!--@EndIf--> <!--@If(Field.Type!="Radio")--> <label for="<!--@Field.Systemname-->" class="left <!--@If Defined(Field.Required)-->required<!--@EndIf(Field.Required)--> <!--@Field.ValidationValue-->"> <!--@Field.Label--> <!--@If Defined(Field.Required)--> *<!--@EndIf(Field.Required)--> </label> <!--@Field.Control--> <!--@EndIf--> <!--@If Defined(Field.Description)--> <span class="description"> <!--@Field.Description--> </span> <!--@EndIf(Field.Description)--> </div> <!--@LoopEnd(Form.Fields)--> <!--@Form.Button.Submit--> <!--@Form.Button.Reset--> <!--@Form.End-->
Morten Fink Eriksen
Posted on 30/01/2013 08:00:38
Thanks Morten
But im suprised that i can't find any mention of this anywhere in the documentation?
Nicolai Høeg Pedersen
Posted on 30/01/2013 10:42:49
Hi Morten
Yes, that is not good enough. Will have the template documentation updated.
BR Nicolai
You must be logged in to post in the forum