Advanced coding?

firefly 11 Feb, 2011
Hi

I would like my contact form to look a bit like a letter. Is there a way to:

1. show 'todays' date at the top of the form

2. copy the text inputted into the name field so that it displays down the bottom of the form and it looks like they have signed it (so it's basically just a copy of a specific input field that shows up client side).

Not sure if these things are possible? Any instructions/ advice would be greatly appreciated.

Many thanks
GreyHead 11 Feb, 2011
Hi firefly,

1) You can add this code to display a date
<div><?php echo date('m-d-Y'); ?></div>
.

You might want to put that in a ChronoForms text element to match the formatting.

You can copy a field value with a little JavaScript. First add a placeholder to your Form HTML
<div id='copy_name'></div>
Then add this to the Form JavaScript box (assuming that the name input has id='name'
window.addEvent('domready', function() {
  $('name').addEvent('keyup', function() {
    $('copy_name').setHTML($('name').value);
  });
});

Bob
firefly 11 Feb, 2011
Thanks so much Bob.

I will give it a go.

Great support and component as always!
This topic is locked and no more replies can be posted.