wow!  I never knew u could add elements with _javascript_.  If there are more than one element per table, how does one make _javascript_ do that? :)
  ----- Original Message -----
  From: Claude Schneegans
  To: CF-Talk
  Sent: Tuesday, August 10, 2004 9:36 PM
  Subject: Re: add form elements online

  >>I want to setup a way for my client to add form elements online.

  I suppose you mean client side?
  I have applications that do this in _javascript_.
  Inside the form is a table, and I use a function that adds a row in the table, a TD inside the row,
  and an INPUT field in the TD. Ie:

  <FORM...>
  <TABLE ID="myTable"....>
  ...
  </TABLE>
  </FORM>
  ....
  <SCRIPT>
  function addField()
      {
      var table = getElementById("myTable");
         // create new row in table
     var tr = table.insertRow();
     var td = tr.insertCell();
     td.innerHTML = "_expression_&nbsp;";
     td = tr.insertCell();
     td.innerHTML = '<INPUT TYPE="checkbox" ...etc... >';
      }
  </SCRIPT>

  Et voilà... ;-)
  Of course, the table may contain more elements.

  It probabily won't work with Mozzilla, and I did not try to find a way to do it  with Mozzilla.
  When there is a decent documentation about Mozilla's _javascript_, I may spend some time to take a look.
  --
  _______________________________________
  REUSE CODE! Use custom tags;
  See http://www.contentbox.com/claude/customtags/tagstore.cfm
  (Please send any spam to this address: [EMAIL PROTECTED])
  Thanks.
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]

Reply via email to