Bootstrap input change color

<< Click to Display Table of Contents >>

Navigation:  Forum >

Bootstrap input change color

Forum link

 


 

06-02-2020, 08:43 PM:

 

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

 


 

06-08-2020, 10:20 AM:

 

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

 


 

06-08-2020, 01:13 PM:

 

>>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

 


 

06-09-2020, 11:34 AM:

 

Thank your for your answer.

 

I'm using Delphi, any chance explaning me how to put that in Delphi code?

 

Kind regards,

 

Bostjan

 


 

06-09-2020, 12:05 PM:

 

Hi. In Delphi:

 

Code:

 

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

 

Code:

 

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