I have need to dynamically change label for a text field. The Label method (https://appgini.bizzworxx.de/products/j ... ew/labels/) works well. However, this happens to be a required field, so the html has <span class="text-danger"><%%TRANSLATION(*)%%></span> for the label to present the * mandatory indicator. How can I get that * displayed after using the Label method?
I have updated the tablename_templateDV.html file to add an id for the label, then I manually append the html to the label in the tablename-dv.js file. I don't like this because I have to set this to Read Only so I don't overwrite it every time I regen. I don't like having to do that because eventually I will need to change that template and my changes won't take (because I will forget that it's Read Only).
Any ideas?
TIA
~Paul
AppGini 5.82 revision 1101
Change label, show * for mandatory
Re: Change label, show * for mandatory
Code: Select all
var fieldname = "type_id"; // change this
new AppGiniField(fieldname).label("my new label");
$j("label[for=" + fieldname + "]").append("<span class=\"text-danger\">*</span>");
Jan
PS: In next version it will be just enough to call the .label("caption") function which will automatically keep the red required-*. It will also automatically care for keeping the blue info-bubble if there is a field description.
Kind regards,
<js />
My AppGini Blog:
https://appgini.bizzworxx.de/blog
You can help us helping you:
Please always put code fragments inside
AppGini 24.10 Revision 1579 + all AppGini Helper tools
<js />
My AppGini Blog:
https://appgini.bizzworxx.de/blog
You can help us helping you:
Please always put code fragments inside
[code]...[/code]
blocks for better readabilityAppGini 24.10 Revision 1579 + all AppGini Helper tools
Re: Change label, show * for mandatory
Awesome, works like a champ! Thanks Jan!
Future sounds great too.
~Paul
Future sounds great too.
~Paul
SOLVED: Change label, show * for mandatory
Thanks, Paul, I'm happy it works for you!
Kind regards,
<js />
My AppGini Blog:
https://appgini.bizzworxx.de/blog
You can help us helping you:
Please always put code fragments inside
AppGini 24.10 Revision 1579 + all AppGini Helper tools
<js />
My AppGini Blog:
https://appgini.bizzworxx.de/blog
You can help us helping you:
Please always put code fragments inside
[code]...[/code]
blocks for better readabilityAppGini 24.10 Revision 1579 + all AppGini Helper tools