608
Views
4
Comments
Solved
Javascript on button
Question

whenever i click button, i want to change its color to red, but its not working . i have set the button to navigate and below is my js code in extended property.

SyntaxEditor Code Snippet

"
document.getElementById("+button1.Id+").style.backgroundColor=Red;
"

jss.png
2020-03-05 14-29-02
José Costa
Solution

Hi Lovish,

Set the button to Ajax Submit and try this:

"
document.getElementById('"+button1.Id+"').style.backgroundColor='Red';
"

Cheers,

José

UserImage.jpg
Lovish Goyal

José Costa wrote:

Hi Lovish,

Set the button to Ajax Submit and try this:

"
document.getElementById('"+button1.Id+"').style.backgroundColor='Red';
"

Cheers,

José


Work fine without ajax. By the way thanks Jose

2018-11-06 14-26-44
Suraj Borade

Hi Lovish,

Try your javascript code like this.

"
document.getElementById('"+button1.Id+"').style.backgroundColor=Red;
"


UserImage.jpg
Lovish Goyal

Suraj Borade wrote:

Hi Lovish,

Try your javascript code like this.

"
document.getElementById('"+button1.Id+"').style.backgroundColor=Red;
"



its not working. It always happen lsame present in screenshot

jss2.png
2020-03-05 14-29-02
José Costa
Solution

Hi Lovish,

Set the button to Ajax Submit and try this:

"
document.getElementById('"+button1.Id+"').style.backgroundColor='Red';
"

Cheers,

José

UserImage.jpg
Lovish Goyal

José Costa wrote:

Hi Lovish,

Set the button to Ajax Submit and try this:

"
document.getElementById('"+button1.Id+"').style.backgroundColor='Red';
"

Cheers,

José


Work fine without ajax. By the way thanks Jose

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