NetTalk Central

Author Topic: hide - unhide changes the spacing of fields  (Read 4929 times)

ccordes

  • Sr. Member
  • ****
  • Posts: 384
    • View Profile
    • Email
hide - unhide changes the spacing of fields
« on: October 10, 2009, 09:26:36 AM »
Hi

I have a set of 4 values that can be entered in metric or imperial units.
Before those fields, I have Radio buttons to select how they will be entered.
Metric or Imperial
Then I have 8 fields 2 for each value to be entered. one value has the hidden condition choice = metric and the other has choice = Imperial

The fields actually do hide and unhide when that radios are selected BUT when the default is selected, the 4 visible rows look as they should
when the other is selected, the one set hides and the other becomes visible but now they have an empty row between them all.
In IE it is weirder because they always have the empty rows between and then the fields just alternate visible or invisible.
 
Before I start fiddling, is there some way around this?

Thanks
chris
Real programmers use copy con newapp.exe

Alberto

  • Hero Member
  • *****
  • Posts: 1873
    • MSN Messenger - alberto-michelis@hotmail.com
    • View Profile
    • ARMi software solutions
    • Email
Re: hide - unhide changes the spacing of fields
« Reply #1 on: October 11, 2009, 05:53:09 AM »
I would use four local variables,and assign they to the metric or imperial fields with embeeded code.

Alberto
-----------
Regards
Alberto

Rob Mikkelsen

  • Full Member
  • ***
  • Posts: 107
    • Yahoo Instant Messenger - flashpott
    • View Profile
    • Email
Re: hide - unhide changes the spacing of fields
« Reply #2 on: October 11, 2009, 09:23:50 AM »
The HIDE condition creates the code but does not display it.  If you are not trying to change the code on the fly via AJAX then you can define what gets displayed in the INCLUDE condition.  As I understand it, the code here does not even get built if it fails the check.

I did this with one form and found that there may be a _slight_ space in the form, but nothing like using the "HIDE" condition.  Remember that the logic is reversed for this, but it may do the trick.

If that doesn't work, I agree that using a common memory variable to display and input the data would work, providing you put embedded code into the appropriate file fields would also do the job.

Rob

ccordes

  • Sr. Member
  • ****
  • Posts: 384
    • View Profile
    • Email
Re: hide - unhide changes the spacing of fields
« Reply #3 on: October 12, 2009, 07:53:50 AM »
Thanks.
I think the answer is to find a way to not use the hide/unhide.
Local variables which feed into the database and handle the conversion sounds like a good idea in this case.

Real programmers use copy con newapp.exe

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: hide - unhide changes the spacing of fields
« Reply #4 on: October 12, 2009, 07:54:06 PM »
Chris,

I haven't seen this issue with Hide and Unhide before.
the effect is slightly different from one browser to the next, but it should properly "hide". Remember though, that on your radio button, you _MUST_ reset Prompt, Entry and Comment of the dependant field.
If you only hide say Entry, but leave prompt and comment, then only the entry part gets hidden / unhidden.

Cheers
Bruce

ccordes

  • Sr. Member
  • ****
  • Posts: 384
    • View Profile
    • Email
Re: hide - unhide changes the spacing of fields
« Reply #5 on: October 13, 2009, 05:23:04 AM »
Yes, all of that has been done.
What I don't understand is why the default hide works and all of the shown fields look ok and are spaced properly. The change is what goes wrong.
Using Firebug, we can see that the browser may think that there are double div tags around each field. One hidden one not.
Using Fiddler proxy we can see that the script is just retagging everything with hdiv.
The other thing I don't understand is how hdiv is hiding anything. It has border-collapse but that doesn't hide things.

chris
Real programmers use copy con newapp.exe