Whats wrong with this statement.
if (data.bookingtype = 'Corporate') {
jQuery('#rentalprice').val(data.baserentalprice);
} else if (data.bookingtype = 'Groups') {
jQuery('#priceperperson').val(data.baserentalprice);
} else if (data.bookingtype = 'Leisure') {
jQuery('#priceperperson').val(data.baserentalprice);
}
I am trying to populate a field based on the value of the bookingtype variable sent back from my ajax request.
If bookingtype is Corporate then populate the #rentalprice input, else if its Groups or Leisure then populate the #priceperperson input. At the moment it always populate the #rentalprice input.
==or===(equality operator) instead of=(assignment operator)