Skip to main content
JH313
Participant
May 16, 2017
Resuelto

when name entered in one text field, add both name + current date to another

  • May 16, 2017
  • 2 respuestas
  • 767 visualizaciones

Can someone correct my script?

I have 4 people that I want to use a form, and when they type their names at the top of the form, it writes the same name and current date in a field at the bottom.

This is what I have, but it's not working:

if (event.value=="John Doe") {

    this.getField("Prepared by and date").value = "John Doe util.printd("mm/dd/yyyy", new Date())";

} // end switch;

if (event.value=="Jenny Doe") {

    this.getField("Prepared by and date").value = "Jenny Doe util.printd("mm/dd/yyyy", new Date())";

} // end switch;

if (event.value=="Joy Doe") {

    this.getField("Prepared by and date").value = "Joy Doe util.printd("mm/dd/yyyy", new Date())";

} // end switch;

if (event.value=="James Doe") {

    this.getField("Prepared by and date").value = "James Doe util.printd("mm/dd/yyyy", new Date())";

}

FYI I'm a novice. Thanks in Advance

Este tema ha sido cerrado para respuestas.
Mejor respuesta de Bernd Alheit

Use this:

this.getField("Prepared by and date").value = event.value + " " + util.printd("mm/dd/yyyy", new Date());

2 respuestas

Bernd Alheit
Community Expert
Bernd AlheitCommunity ExpertRespuesta
Community Expert
May 16, 2017

Use this:

this.getField("Prepared by and date").value = event.value + " " + util.printd("mm/dd/yyyy", new Date());

JH313
JH313Autor
Participant
May 16, 2017

Thanks!