Dynamically fill in form fields / JS onchange events

Building

theneilkirk     2 months ago

Hi

I'm trialing saltcorn, and, having played with a few other no-code builders, am impressed with how well it runs and works!

Is there any way that I could populate form fields based on other information entered? For example, a user enters a cost and then the sale price gets set up cost + defauly margin. The user is obvisouly free to change the sale price if they want to.

I suspect it's with a bit of (JS) code on an edit view. Ideally, I'd like to set a onchange event to the cost field which simply update the value of the sale price.

Is it possible to do this somehow?

Thanks in advance



No row selected
No row selected
      22 days ago

You could do this with a calculated field.

 

  1. create the calculated field which works out the suggested price based on the cost and whatever else
  2. create a float field which is the final price
  3. create the initial edit page where the user enters the cost and other info
  4. configure the view so that after the user hits save they go to a second edit view
  5. the second edit view shows them the suggested price and allows them to type their desired price into the 'final price' field.


Sign up to post a reply