if (Trim(document.getElementById("txtAffiliateName").value)=""){
alert("Please enter 'Affiliate Name'.");
document.getElementById("txtAffiliateName").focus();
return false;
}
When I use this code in ASP.NET it give the alert :
Microsoft JScript runtime error: Cannot assign to a function result
With continue,ignore,break
options,when I click on continue
it goes to page load and working properly and when I click on break
it stops the execution.
if (document.getElementById("txtAffiliateName").value="") {
alert("Please enter 'Affiliate Name'.");
document.getElementById("txtAffiliateName").focus();
return false;
}
When I remove the Trim
the alert error message is not showing. But the TextBox
value will be empty on button click.
What is the solution for this?