List of articles   Colour designations   Choose language


Sending of hidden tree of tags



It's necessary to put hidden tree of elements inside html-element hidden to attach them to form: hidden tree of elements will be sent to server together with elements, generated by controls.

<form>
  <hidden>
    <aaa#bbb attribute=value>
      <ccc#ddd attribute2=value2>
    </aaa>
  </hidden>
</form>
<aaa#bbb attribute=value>
  <ccc#ddd attribute2=value2>
</aaa>
 
<form>
  <hidden>
    <a#ref a1=v1>
  </hidden>
      <input name=a2 value=v2>
      <input name=a3 type=file>
  <hidden>
      <b b1=bb/>
    </a>
  </hidden>
</form>
<a#ref a1=v1 a2=v2 a3=filename.ext>
  <b b1=bb/>
</a>
<?file attr=a3 value=filename.ext xml:size=7>Y29udG</file>
 
<form>
  <hidden>
    <data a1=v1>
  </hidden>
      <tr id=order#ref repeat=template>
        <td><input type=text name=row[order].product></td>
        <td><input type=text name=row[order].quantity></td>
        <td><button type=remove>Remove This Row</button></td>
      </tr>
      <tr>
        <td><button type=add template=order>Add Row</button></td>
      </tr>
  <hidden>
    </data>
  </hidden>
</form>
<data a1=v1>
  <order#ref product=p1 quantity=q1>
  <order#ref product=p2 quantity=q2>
  <order#ref product=p3 quantity=q3>
</data>

<input type=hidden> should be abolished.

If tag hidden is inside alternative block, then hidden data will be sent only if radio/checkbox-button is pressed.

<tr id="ecommerce">
  <td><input type="text" name="number"></td>
  <td><input type="text" name="expire"></td>
  <hidden>
    <a attr="k">
      <b>
      <c>
      <d something="m">
    </a>
  </hidden>
</tr>
<tr>
  <td><input type="radio" name="method" value="cc"
       template="ecommerce">Show Row</button></td>
</tr>
<tr id="ecommerce">
  <td><input type="text" name="number"></td>
  <td><input type="text" name="expire"></td>
  <hidden>
    <a attr="k">
      <b>
      <c>
      <d something="m">
    </a>
  </hidden>
</tr>
<tr>
  <td><input type="checkbox" name="method" value="cc"
       template="ecommerce">Show Row</button></td>
</tr>


Dmitry Turin



List of articles   Colour designations   Choose language