1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

JavaScript RegExp var

Discussion in 'Software Development' started by henry214, Feb 10, 2005.

Thread Status:
Not open for further replies.
  1. henry214

    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.
     
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 733,556 other people just like you!

Loading...
Similar Threads - JavaScript RegExp
  1. avaisali
    Replies:
    1
    Views:
    405
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/329007

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice