Want to get rid of Google Ads, click here.
+ Reply to Thread
Results 1 to 6 of 6

Thread: Create list with Javascript

  1. #1

    Default Create list with Javascript

    Hi all,

    I am doing test with Javascript, I'm new using that.

    I want to create a list through the Javascript in format control.

    Right now I am able to write in the Caption Condition [$mytest] and then in the JavaScript section of the form I write down

    system.vars.$mytest="Javascript";

    And in my form I have "Javascript" that is displayed. So this is working fine. yay!

    Now

    what I want to do is to fill the list of a Comfill box. Right now I am able to add only ONE value. I type in the Value List Condition: [$mytest]. In the Javascript I try different way to create a list but I am unable to

    * system.vars.$mytest="Javascript, Allo";
    * system.vars.$mytest={"Javascript, Allo"};
    * system.vars.$mytest[0]="Javascript";
    system.vars.$mytest[1]="Javascript";

    But nothing works. How can I fill the variable $mytest so it becomes a list.

    thank you!

  2. #2

    Thumbs up

    I found it. We need to use ;

    system.vars.$maxtest="Javascript;Allo";


  3. #3

    Default

    Well, I will use this topic again for another question.

    How do I gather a variable from a form within Javascript?

    In calculation we do: category in $file

    In Javascript?: ...

    I tried system.var.category, but it doesn't works. Seems like system.var only works with variable with a $ (like $category).

    thank you again.. lol

  4. #4
    Senior Member mateuszk's Avatar
    Join Date
    Nov 2006
    Posts
    302

    Default

    Quote Originally Posted by Etdashou View Post
    I tried system.var.category, but it doesn't works. Seems like system.var only works with variable with a $ (like $category).
    record.category
    record['category']
    vars.$L_file.category
    vars.$file.category
    ...

  5. #5

    Default

    thank you mateuszk.

    Is there one of them I should use more than other, or it's all ok?

    thx

  6. #6
    Senior Member mateuszk's Avatar
    Join Date
    Nov 2006
    Posts
    302

    Default

    "record" is widely mentioned in the documentation
    but it's more of a question "where should I use what"
    (sorry, I'm not going to reply to that one, though, lots of examples etc.)

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Bookmarks

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts