I am trying to prevent showing a £ symbol when a user clicks on an edit button.
I do this like so:
var form = document.forms[1];
var data = document.getElementsByTagName("td");
var fixOrPerc = data["Sales-" + intID].innerHTML;
form.SalesFixed.value = fixOrPerc.substring(1, fixOrPerc.length - 1);
This does work correctly when i have a value like so:
£10.00
But the problem is that i allow negative numbers like so
-£10.00
When negative numbers are entered and the edit button is clicked on then it removed the minus sign but keeps the £ symbol…
Above this there is a form selecting all of the fields from a table, each having an Edit button. When the edit button is clicked it fires the following function:
function Edit(intID) {
var form = document.forms[1];
var data = document.getElementsByTagName("td");
var valSalesFixed = "";
var fixOrPerc = data["Sales-" + intID].innerHTML;
if (data["Sales-" + intID].innerHTML.indexOf("%") >= 0) {
form.SalesPercent.value = data["Sales-" + intID].innerHTML.replace("%", "");
} else {
form.SalesFixed.value = fixOrPerc.substring(1, fixOrPerc.length - 1);
}
}
Now i have just tried putting in your code but that doesn’t work either