As a beginner programmer, I have encountered an issue with a gridview that contains a button repeated in every row. This button is part of an item template and when clicked by the user, it should change the value of another textbox column using JavaScript. Although my initial attempt seemed to work perfectly, I noticed that when clicking the button in a row, the text of the corresponding textbox changes momentarily before disappearing, as if there was a postback occurring. How can I prevent this behavior?
OnclientClick ="myFunct(this)"
function myFunc(x){
var id=x.id;
var newID = id.substring(0, 18);
newID+="TextBox1";
document.getElementById(newID).value="ghjhghjg";
}
Regards