form

Announce a form which will be used for ajax calls.

  • publish Set whether to auto-publish node after save.
  • klass set the class of newly created nodes
  • mode redirect page mode
  • t_id id of node used to render ajax template
see add, drop, each, edit, input, name, remote update
<r:form mode='team'><form>
  <ul>
    <li><b>select team members</b></li>
    <li><r:checkbox name='mate_ids' nodes='contacts in site'/></li>
    <li><r:input type='submit'/></li>
  </ul>
</form></r:form>

<h3>drop updates icon, with form</h3>
<div do='drop' change='params' d='[id]' do='if' test='param:d'>
  <r:node where='id eq param:d' in='site'>
    Change icon to <r:img mode='tiny'/> ?
    <r:form t_id='[main.id]'>
      <r:input type='hidden' name='icon_for_id' set_value='[main.id]'/>
      <r:input type='hidden' name='m_title' set_value='becoming icon for [main.name]'/>
      <r:textarea name='m_text'/>
      <input type='submit'/>
    </r:form>
  </r:node>
  <r:else>
    please drop a node to change the icon
    <r:icon>
      <r:img mode='pv'/>
      <ul do='comments'>
        <li do='each'>
          <b do='[title]'/> <b do='[author_name]'/>
          <div do='{text}'/>
        </li>
      </ul>
    </r:icon>
  </r:else>
</div>

You can omit the <form> element and it will be added to wrap the content but there are cases where you definitely need both: declare the whole form and place the actual form elements. For example:

<table do='mates'>
  <tr do='each'><td do='link'/></tr>
  <tr do='form'><td><form>...</form></td></tr>
  <tr do='add'><td><r:add_btn/></td></tr>
</table>