Scribusoid

Author Topic: I need help in javascript programming - urgent  (Read 2792 times)

Willig

  • Newbie
  • *
  • Posts: 4
  • Karma: 0
I need help in javascript programming - urgent
« on: April 09, 2011, 08:35:59 pm »
Dear Scribus users,

I am developping PDF documents including fields, which should be linked to other fields, and I am not able to perform the javascript programm todo the following task on my own :

I need a first listbox field in which the enduser has to select an option among others. According to this first choice, he would have a second listbox field, in which the different options woud vary according to the response to the first one. Could somebody help me to write the basis of such a programm, as I am not experienced in javascript programming?

Examples of the choice of the first listbox : choiceA  choiceB  choiceC
examples of the second list box : choiceA1 choiceA2 choiceA3 if selected choiceA
choiceB1 choiceB2 choiceB3 if selected choiceB from the first listbox

Thank you so much for your help

I know that there is a specifically dedicated section, but my first post did not excite anybody, so that I try again in the main section of the forum. The tool I am thinking about must be ready by the beginning of the coming week, and i am desperatly stuck!!!!

owencook

  • Newbie
  • *
  • Posts: 10
  • Karma: 0
Re: I need help in javascript programming - urgent
« Reply #1 on: April 13, 2011, 01:36:33 am »
Dear Scribus users,

I am developping PDF documents including fields, which should be linked to other fields, and I am not able to perform the javascript programm todo the following task on my own :

I need a first listbox field in which the enduser has to select an option among others. According to this first choice, he would have a second listbox field, in which the different options woud vary according to the response to the first one. Could somebody help me to write the basis of such a programm, as I am not experienced in javascript programming?

Examples of the choice of the first listbox : choiceA  choiceB  choiceC
examples of the second list box : choiceA1 choiceA2 choiceA3 if selected choiceA
choiceB1 choiceB2 choiceB3 if selected choiceB from the first listbox

Thank you so much for your help

I know that there is a specifically dedicated section, but my first post did not excite anybody, so that I try again in the main section of the forum. The tool I am thinking about must be ready by the beginning of the coming week, and i am desperatly stuck!!!!

Does this link help?http://wiki.scribus.net/canvas/How_to_enhance_your_PDF_forms_with_JavaScript

Willig

  • Newbie
  • *
  • Posts: 4
  • Karma: 0
Re: I need help in javascript programming - urgent
« Reply #2 on: April 13, 2011, 10:33:53 pm »
I already tried this page, but I do not succeed to load a series of different option in the dependant listbox, according to the first listbox choice. The only thing I succeed is to display a unique line as the response of the choide. Coult you help me to modify the following lines of code :
var one = this.getField("sex");
var two = this.getField("names");
if (one.value == 'boy') {
    two.value=[['500'],["600"],["700"]]
} else if (one.value == 'girl') {
    two.value=[['300'],["200"],["100"]]
}

Whatever sepator I use between the options, I retrieve only the first line

With all my thanks

 

palmate