711
Views
4
Comments
Solved
Add class using javascript
Question

Hi,

I am having a problem in how to declare the Script, I made. I want to add the class "inputfield_bordergreen" in the InputText_Field.


2020-01-08 08-43-00
Rahul Kumar
Solution

Hi , 

i think you are doing ajax refresh after the RunJavaScript, due to which class is removing from your screen.

Try to change the sequence ..


Hope this help

Regards,

Rahul

UserImage.jpg
Gerald Emmanuel Malaca

Rahul Kumar wrote:

Hi , 

i think you are doing ajax refresh after the RunJavaScript, due to which class is removing from your screen.

Try to change the sequence ..


Hope this help

Regards,

Rahul


Hi Rahul,

I tried your suggestion and it works,  I also made a mistake,  instead of "classList", I declared it as "classlist" thank you again 


Regards

Gerald Malaca 

UserImage.jpg
João Cardoso

Hi Gerald,

Instead "element.classlist.add ... " try

"document.getElementById('" + InputText_Field + "').classList.add("inputfield_bordergreen");"



UserImage.jpg
Gerald Emmanuel Malaca

João Cardoso wrote:

Hi Gerald,

Instead "element.classlist.add ... " try

"document.getElementById('" + InputText_Field + "').classList.add("inputfield_bordergreen");"



Hi Joao, 


I tried your solution but it is not working,




2020-01-08 08-43-00
Rahul Kumar
Solution

Hi , 

i think you are doing ajax refresh after the RunJavaScript, due to which class is removing from your screen.

Try to change the sequence ..


Hope this help

Regards,

Rahul

UserImage.jpg
Gerald Emmanuel Malaca

Rahul Kumar wrote:

Hi , 

i think you are doing ajax refresh after the RunJavaScript, due to which class is removing from your screen.

Try to change the sequence ..


Hope this help

Regards,

Rahul


Hi Rahul,

I tried your suggestion and it works,  I also made a mistake,  instead of "classList", I declared it as "classlist" thank you again 


Regards

Gerald Malaca 

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.