Clearing a value from a BS input

These two onclick functions do not clear values that are in Bootstrap 4 inputs

buttonClearCustomer.onclick=function(){
  $('#inputCustomer').value('');
  $('#inputContract').value('');
  ClearCustomerAndContractVars();
}

buttonClearContract.onclick=function(){
  $('#inputContract').value('');
  contract_id = '';
  contract_name = '';
}

I also tried this version

$('#inputCustomer').value='';
$('#inputContract').value='';

Any thoughts?

inputCustomer.value=""

Thanks, that does not work either.

Use .val() vs .value().

For example:
$(’#inputCustomer’).val(’’);

That worked. But, I am confused by .value would not worked as documented in the AS controls doccs for a BS input?

The .value in AS refers to the value of the input field. In the example, we’re using jquery and as such there is no .value() method.

In AS (Appstudio) you would the syntax would be youObject.value will give you the string value of yourObject.

Sorry. Uppercase V. inputCustomer.Value=""


ryansy

    January 1

Thanks, that does not work either.


Visit Topic or reply to this email to respond.


In Reply To


lotsofcows

    January 1

inputCustomer.value=""


Visit Topic or reply to this email to respond.

To unsubscribe from these emails, click here.

inputCustomer.value=""

should do the job. If it doesn’t, the issue is something else. Try creating a simple project with just an inputCustomer control and testing that.

Anything in the Console?