Developer forum

Forum » Development » Forms DW7 cannot use systemname in fieldoptions

Forms DW7 cannot use systemname in fieldoptions

Morten Fink Eriksen
Reply

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.
 


Replies

 
Nicolai Høeg Pedersen
Reply

Could you please submit your template?

 
Morten Fink Eriksen
Reply
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)-->&nbsp;*<!--@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
Reply

Been a while since i've heard something, anything new in relation to this?

 
Morten Bengtson
Reply

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)-->
        &nbsp;*<!--@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
Reply

Thanks Morten

 

But im suprised that i can't find any mention of this anywhere in the documentation?

 
Nicolai Høeg Pedersen
Reply

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