masterjake
New Member
- Messages
- 73
- Reaction score
- 0
- Points
- 0
Hi. I'm having a problem. I have various text fields with ID's of a letter and a number e.g. "A1", "C3", etc.
When this JavaScript function runs it is suppose to replace all occurrences of "{stuff here}" with the value at the cell number within the {}.
For example, if they type in "{A1}+{B2}" then the JavaScript should find {A1} and replace it with the value of the element who's ID is "A1."
Here is what I have. I know it's a problem with the "$1."
When this JavaScript function runs it is suppose to replace all occurrences of "{stuff here}" with the value at the cell number within the {}.
For example, if they type in "{A1}+{B2}" then the JavaScript should find {A1} and replace it with the value of the element who's ID is "A1."
Here is what I have. I know it's a problem with the "$1."
Code:
var editedExpression = eqvalue.replace(/\{(.+?)\}/g, document.getElementById("$1").value);