Reset the value of an input element

Elements:

User Input:

  • Name: #name
  • Email: #email
  • Phone: #phone
  • How would you like to be contacted?: #dropdown1
  • Message: #message

Button Element:

  • Reset Button: #resetButton  |  Add onClick event in the Properties Panel

Wix Code:

export function resetButton_click(event) {

$w('#name').value = "";

$w('#email').value = "";

$w('#phone').value = "";

$w('#message').value = "";

$w('#dropdown1').value = "How would you like to be contacted?";

$w('#name').resetValidityIndication();

$w('#email').resetValidityIndication();

$w('#phone').resetValidityIndication();

$w('#message').resetValidityIndication();

$w('#dropdown1').resetValidityIndication();

}