Placing form elements in the table

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jabili
    New Member
    • Aug 2007
    • 3

    #1

    Placing form elements in the table

    I have an xml file using which the controls should be created through XSL.
    I have a problem with placing the controls in a table depending on the NOOFCOLS attribute.
    XML:
    ------
    <FORMS_METADATA >

    <CONTAINER ID="1" TYPE="1" CREATEDIV="Y" CSSCLASSNAME="f ormlegend" NAME="Risk Library Details" NOOFCOLS="2" VIEWMODE="1">
    <CONTROL_ID>2 </CONTROL_ID>
    <CONTROL_ID>3 </CONTROL_ID>
    <CONTROL_ID>7 </CONTROL_ID>
    <CONTROL_ID>8 </CONTROL_ID>

    </CONTAINER>
    </FORMS_METADATA>

    CONTROL_ID: 2 is textbox
    CONTROL_ID: 3 is Button
    CONTROL_ID: 7 is textarea
    CONTROL_ID: 8 is radiobutton

    Using the NOOFCOLS attribute i hv to place these controls in a table. I could only display these controls in either a single row or single column.
    Can some1 help me in doin this please....!
  • lakshi
    New Member
    • Aug 2007
    • 1

    #2
    how to calculate the distance between two cities using javascripts

    Comment

    • jkmyoung
      Recognized Expert Top Contributor
      • Mar 2006
      • 2057

      #3
      The typical solution is something like: (in the CONTAINER context)
      [CODE=html]<xsl:variable name="width" select="@NOOFCO LS"/>
      <xsl:for-each select="CONTROL _ID[position() mod $width = 1]">
      display control here
      <xsl:for-each select="followi ng-sibling::CONTRO L_ID[position() &lt; $width]">
      display this control here.
      </xsl:for-each>
      </xsl:for-each>[/CODE]

      How do you determine what each of the controls are? Is it just arbitrary?

      Comment

      Working...