Atozed Forums

Full Version: Bootstrap input change color
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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
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
>>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
Thank your for your answer.
I'm using Delphi, any chance explaning me how to put that in Delphi code?

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