Can I control the message displayed when a required rule is fired?

  • 0
  • 1
  • Question
  • Updated 3 years ago
  • Answered

I have a form that has two dropdown fields.  I have setup rules that if one is not selected the other is required and vice versa.  When I get the message that the required field is required the message displays as "The field ??? is required".  Is there any way to customize this message to say what the required field is so the user knows where they went wrong?

Thanks

Photo of Brian

Brian

  • 140 Points 100 badge 2x thumb

Posted 3 years ago

  • 0
  • 1
Photo of Ⲇanom the ultimate (Dan Diebolt)

Ⲇanom the ultimate (Dan Diebolt), Champion

  • 30,224 Points 20k badge 2x thumb
Yes this is easy to do using the image onload technique and the Let Me Mutation Observe That For You technique.

You can adopt this answer which uses the Let Me Mutation Observe That For You technique:

https://haversineconsulting.quickbase.com/db/bgcwm2m4g?a=dr&rid=274


I didn't test it because I am busy working on my voice controlled QuickBase project but this is probably the only statement you need to change:

$("#qbDialogMessage:contains(The field fieldname is required.)").html("Kilroy was here");

See:

https://haversineconsulting.quickbase.com/db/bgcwm2m4g?a=dr&rid=503

Let Me Google That For You: Mutation Observer
http://lmgtfy.com/?q=mutation+observer

https://www.youtube.com/watch?v=GNVsHrFiBy0
Photo of Brian

Brian

  • 140 Points 100 badge 2x thumb
Thanks for the reply but where do I place this code?
Photo of Ⲇanom the ultimate (Dan Diebolt)

Ⲇanom the ultimate (Dan Diebolt), Champion

  • 30,224 Points 20k badge 2x thumb
Follow the link in the Notes field of the pastie for instructions.
Photo of Brian

Brian

  • 140 Points 100 badge 2x thumb
Ok...thanks.  Surprised QB has created this ability right from the GUI.
Photo of Brian

Brian

  • 140 Points 100 badge 2x thumb
not
Photo of Ⲇanom the ultimate (Dan Diebolt)

Ⲇanom the ultimate (Dan Diebolt), Champion

  • 30,224 Points 20k badge 2x thumb
But if QB had this ability in the GUI you would not have to opportunity to explore the delights of Mutation Observers!
Photo of Ⲇanom the ultimate (Dan Diebolt)

Ⲇanom the ultimate (Dan Diebolt), Champion

  • 30,224 Points 20k badge 2x thumb