Fingerprint
Programmer
Hi,
hope someone can help because this is a pain in the bum!
I have written some code as part of a validation routine which automatically determines which anchor tag to go to depending on the name of the field that was validated.
The problem is that I keep getting an invalid character message when I run the code, and can't work out how to include the ASCII code for # instead (35).
Here's the code I'm using. constructor is just a string slicer that cuts the original field name down to it's stem, and tst is the form element id picked up from a for loop.
Constructor returns 'str1'.
Does anybody have any ideas?
Thanks guys,
fingerprint
a posse ad esse
hope someone can help because this is a pain in the bum!
I have written some code as part of a validation routine which automatically determines which anchor tag to go to depending on the name of the field that was validated.
The problem is that I keep getting an invalid character message when I run the code, and can't work out how to include the ASCII code for # instead (35).
Here's the code I'm using. constructor is just a string slicer that cuts the original field name down to it's stem, and tst is the form element id picked up from a for loop.
Constructor returns 'str1'.
Code:
constructor(tst);
str2 = eval(str1 + "yn");
alert ('Please check either "Yes" or "No" for this question');
str3 = str1.slice(5);
str3 = String("document.location = #" + str3);
eval(str3);
Does anybody have any ideas?
Thanks guys,
fingerprint
a posse ad esse