JavaScript RegExp var

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

henry214

Thread Starter
Joined
Sep 18, 2004
Messages
28
how do I get a form.value inside var using javascript

i.e.

var all_files = new Array();
var all_files_values = new Aray();
all_files = form.hidden_dev_files.value; (grabbed from Perl code)

for (var i=0;i<all_files.lenght;i++){
var pattern = /form.SEARCH.value/g; :mad:
if(pattern.test(all_files)) {
body = body + '<OPTION ';
body = body + 'value=\"' + all_files + '\">' + all_files + '</OPTIONS>\";
}
...
....

I cannot get the var pattern form.SEARCH.value into the /RegExp/

I have tried

srch = form.SEARCH.value and then using
var pattern = /srch/g;

also

var pattern = /eval(form.SEARCH.value)/g;

I cannot get the form value inside the regexp .
I know it is set, becuase I fall into this portion if form.SEARCH.value != ''

Thank you for your help.
 
Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 807,865 other people just like you!

Latest posts

Members online

Top