Atozed Forums
Bootstrap input change color - Printable Version

+- Atozed Forums (https://www.atozed.com/forums)
+-- Forum: Atozed Software Products (https://www.atozed.com/forums/forum-1.html)
+--- Forum: IntraWeb (https://www.atozed.com/forums/forum-3.html)
+---- Forum: English (https://www.atozed.com/forums/forum-16.html)
+----- Forum: IntraWeb General Discussion (https://www.atozed.com/forums/forum-4.html)
+----- Thread: Bootstrap input change color (/thread-1704.html)



Bootstrap input change color - bostjan - 06-02-2020

Hi,

I'm just starting to use IW with bootstrap and of course struggling with basics. 
I have an input field that I would like to change label and text input color from black to red in case user puts wrong information. I can't find any information how could this be achived. Can somebody please explain it to me how can I do that?

Kind regards,
Bostjan


RE: Bootstrap input change color - bostjan - 06-08-2020

Hi!

Since I haven't received any reply I guess I haven't ask clearly enough. 

Is it possible to programmaticaly change color of label/input in bootstrap? If yes, how?

Kind regards,
Bostjan


RE: Bootstrap input change color - MJS@mjs.us - 06-08-2020

>>Is it possible to programmaticaly change color of label/input in bootstrap?

Yes.  Here's how I do it (in async events):

Code:
WebApplication->CallBackResponse->AddJavaScriptToExecuteAsCDATA("$('#LBLSTATS').removeClass('text-info');$('#LBLSTATS').addClass('text-danger');");

Another way:

Code:
WebApplication->CallBackResponse->AddJavaScriptToExecuteAsCDATA("$('#EDNAME').css('background-color', 'red');");


Regards,
Mark


RE: Bootstrap input change color - bostjan - 06-09-2020

Thank your for your answer.
I'm using Delphi, any chance explaning me how to put that in Delphi code?

Kind regards,
Bostjan


RE: Bootstrap input change color - Jose Nilton Pace - 06-09-2020

Hi. In Delphi:
Code:
WebApplication.CallBackResponse.AddJavaScriptToExecuteAsCDATA("$('#LBLSTATS').removeClass('text-info');$('#LBLSTATS').addClass('text-danger');");
Code:
WebApplication.CallBackResponse.AddJavaScriptToExecuteAsCDATA("$('#EDNAME').css('background-color', 'red');");