NetTalk Central

Author Topic: Conditionally Hide Fields with Embed Code  (Read 3459 times)

Stu

  • Hero Member
  • *****
  • Posts: 510
    • View Profile
    • Email
Conditionally Hide Fields with Embed Code
« on: November 06, 2011, 10:57:00 PM »
** This might belong in the Suggestions forum. Not sure if I'm missing something or if it would be a new feature.

I'm looking to be able to have a piece of embed code hide a field (prompt, value and comment). At the moment, the hiding of all three looks to be gotten to a little differently, but all ends up with the "nt-hidden" class.

If you see the screenshot, you'll understand my concern. Instead of using the "hide" template option (which is awesome, no doubt) I want to be able to run some hide logic in an embed (actually, I'm thinking about a template, but I need an embed for that).

The screenshot is only of the Value:: routine, but obviously the embed code would have to be placed in, if they exist, the Prompt:: and Comment:: routines as well.

Bruce, not sure if this is a "can you please make it so", or if it's a "please guide my addled brain" post.

[attachment deleted by admin]
Cheers,

Stu Andrews

linas@debetas.lt

  • Jr. Member
  • **
  • Posts: 52
    • View Profile
    • Email
Re: Conditionally Hide Fields with Embed Code
« Reply #1 on: November 07, 2011, 06:47:50 PM »
Hi Stu,
What I do in that case is that I use session variable which I set at any place I need, in any routine in any embed.. and on the field I wish to hide I just use session variable in "hide condition". For me it works perfect.

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Conditionally Hide Fields with Embed Code
« Reply #2 on: November 07, 2011, 09:46:55 PM »
Hi Linus,

Your suggestion is a good one, however I think what Stu wants to do here though is inject some template code just before the call to DivHeader. So an embed point is probably a good idea.

Stu - I've also broken out the setting of the class in the Prompt routine into a variable (loc:fieldclass) before the call to DivHeader. That'll bring some consistency to the approach.

I've also renamed the routine variable in the Comment section from loc:class to loc:fieldclass to make that consistent as well. This is a "bigger" change because it'll affect exiting hand-code - but the compiler will spit the dummy so it should be easily corrected.

I'm somewhat hesitant to port this back to NT5 because of the variable change, so let me know what your time-scale for this is. NT6 is out on Nov 18.

Cheers
Bruce

Stu

  • Hero Member
  • *****
  • Posts: 510
    • View Profile
    • Email
Re: Conditionally Hide Fields with Embed Code
« Reply #3 on: November 07, 2011, 10:46:59 PM »
Bring on 6 Baby!!!
Cheers,

Stu Andrews