This topic is locked

Two Conditions Add Page

10/22/2010 6:52:39 AM
PHPRunner General questions
M
macskafogo author

I have this fields:

ANSWER (Listbox)

ANSWER2 (Listbox)

CODE (Listbox)
If ANSWER and ANSWER2 is YES,I would like to show CODE field.

I use this code:
var ctrlANSWER = Runner.getControl(pageid, 'ANSWER');

var ctrlANSWER2 = Runner.getControl(pageid, 'ANSWER2');
function func() {

if ((ctrlANSWER.getValue()=="yes") && (ctrlANSWER2.getvalue()="yes"))

{document.getElementById("code").style.display="table-row";

}else{

document.getElementById("code").style.display="none";

}};

ctrlANSWER.on('change', func);

ctrlANSWER2.on('change', func);
What's wrong ?

Thank you.

A
ann 10/22/2010

Hi,
you've missed one equal operation.

Here is the correct line:

if ((ctrlANSWER.getValue()=="yes") && (ctrlANSWER2.getvalue()=="yes"))



Also make sure you've added the id=code in the HTML mode on the Visual Editor tab (bold):

{BEGIN Code_fieldblock}

<tr id=code><td class=shade width=150>

{BEGIN Code_label}{$label userstable Code}{END Code_label}

</td><td width=250>

{$Code_editcontrol}

</td></tr>

{END Code_fieldblock}

P
piobote 10/23/2010



Hi,
you've missed one equal operation.

Here is the correct line:

if ((ctrlANSWER.getValue()=="yes") && (ctrlANSWER2.getvalue()=="yes"))



Also make sure you've added the id=code in the HTML mode on the Visual Editor tab (bold):


Mister Bob!
Where this code must be put?

M
macskafogo author 10/23/2010

I corrected the error but still does not work.

Any ideas ?

Please help !
Dear Pedro83!

Add Page: Javascript API.

Sergey Kornilov admin 10/23/2010

Mister Bob,
post your application to Demo Account and open a ticket at http://support.xlinesoft.com sending your Demo Account URL. 'Demo Account' button can be found on the last screen in the program.