Skip navigation
ubolrat
Currently Being Moderated

if´s and exit event

Jun 27, 2012 10:57 PM

Hello,

 

I am working on my first form and solving problem after problem but now Im stuck.

 

In my table I want this to happen.

 

If TextField8 is not empty TextField1 should get red border color .

But if TextField1 is not empty it should be black.

 

The proble Im getting is that when I fill TextField8, TextField1 get red bordercolor and if I enter something in TextField1 it turns black.

But If I aleady entered text in TextField1 and then fill TextField8 it still turns red till I click it.

 

So is this problem because There is a exit event on both TextField1 and 8?

 

I am very new to this.

 
Replies
  • Currently Being Moderated
    Jun 28, 2012 12:55 AM   in reply to ubolrat

    Hi,

     

    I suspect that the script in the exit event of TextField8 is NOT testing to see if TextField1 is null or not.

     

    Can you post your form or provide the script that you are using in both fields?

     

    Niall

     
    |
    Mark as:
  • Currently Being Moderated
    Jun 28, 2012 3:45 AM   in reply to ubolrat

    Hi,

     

    You can make this a whole lot simpler. Script in one field in a repeating can easily reference another field in the same row, just be a simple relative reference. You do not need to resolve the node.

     

    I would use the following JavaScript in the exit event of BOTH TextField1 and TextField8:

     

    if (TextField1.rawValue === null && TextField8.rawValue !== null) {
         TextField1.border.edge.color.value = "255,0,0";
    }
    else {
         TextField1.border.edge.color.value = "0,0,0";
    }
    

     

    That should match the logic, but may need a bit of tweaking.

     

    Niall

     
    |
    Mark as:
  • Currently Being Moderated
    Jun 28, 2012 5:29 AM   in reply to ubolrat

    Hi,

     

    You would just need to extend the logic to deal with all of the objects that you need to change visually.

     

    For example, you could have seven if/else statements that look at the .rawValue of a praticular field and TextField8.

     

    Make sense?

     

    Niall

     
    |
    Mark as:
  • Currently Being Moderated
    Jun 28, 2012 6:43 AM   in reply to ubolrat

    Yes, that is correct. If you want to have the visual appearance on the row-by-row basis, then the script above will work.

     

    If on the other hand, you want a user's actions on one row to affect ALL rows, then a loop of FormCalc would do the trick.

     

    However, without seeing the form it is difficult to give a full script. Also I would need to know the full logic for the visual changes.

     

    Niall

     
    |
    Mark as:
  • Currently Being Moderated
    Jun 28, 2012 7:57 AM   in reply to ubolrat

    Hi,

     

    If you upload your form to a file sharing site, like Acrobat.com; Publish it; and them post the published URL here.

     

    I will have a look when I can.

     

    Niall

     
    |
    Mark as:
  • Currently Being Moderated
    Jun 29, 2012 2:18 AM   in reply to ubolrat

    It will be later today!

     
    |
    Mark as:
  • Currently Being Moderated
    Jul 3, 2012 12:42 AM   in reply to ubolrat

    Hi,

     

    Here is the form back to you: https://acrobat.com/#d=DsIMPAPVPUvrnTpuFkkkDQ.

     

    I have deleted the 19 rows and just left one Row1, which is set to repeat in the Object > Binding palette. This means that you only have one row to script and it will be applied to all 20 rows.

     

    Have a look at the script in the exit event of TextField8.

     

    Hope that helps,

     

    Niall

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points