Here is a JavaScript function I am working with:
function editWebsite(IP)
{
document.getElementById('ctl04_txtIP').value = IP;
}
The ctl04_txtIP
textbox represents the IP address
passed through the parameter IP
in the editWebsite
function.
The problem arises when the textbox displays a different value than what was passed. Adding an alert('Any message')
to the function corrects the issue temporarily, but upon removal of the alert, the disparity reappears.
This inconsistency leaves me puzzled as to why it's happening.
I am using Visual Studio 2008 (ASP.NET).
A dynamic link created via C# code triggers this function on click:
"<a href='javascript:void(0)' onclick=\"javascript:editWebsite('" + Convert.ToString(dr["IP"]) + "')\">Edit</a>"