I'm working on building a mileage reimbursement form that has a drop downs with predetermined locations. When two predetermined locations are selected, it will auto fill miles traveled based on a lookup of a SQL table. If Other is selected on either the departure or arrival locations, a field shows to detail that other location.
I'm doing this using standalone fields in a collection rather than a table, because my accounting department would prefer the Other Columns to not show unless necessary. (Other is anticipated to be used less than 5% of the time.)
Here is the view when none of the fields are set to Other:
Here is the view when Other is Selected, displaying the two additional Columns:
As you can see, I can get the fields to line up as needed, but I'm having some trouble making the Purpose field a bit wider, as that one will likely need more space. Also as can be seen, we can take shrink the Date, Miles Traveled, and Amount Fields if needed. I'd like to avoid making any remaining fields smaller if possible.
Here is my CSS:
#q70, #q71, #q72, #q73, #q74, #q78, #q76, #q77 {display: inline-block; width: 12.5%; vertical-align:top;} /* Date */ #q70 label {width: 90%;} #q70 .cf-field {width: 10%;} #q70 .cf-small {width: 75%;} /* To */ #q71 label {width: 90%;} #q71 .cf-field {width: 10%;} #q71 .cf-medium {width: 100%;} /* Other (To) */ #q72 label {width: 90%;} #q72 .cf-field {width: 10%;} #q72 .cf-medium {width: 100%;} /* From */ #q73 label {width: 90%;} #q73 .cf-field {width: 10%;} #q73 .cf-medium {width: 100%;} /* Other (From) */ #q74 label {width: 90%;} #q74 .cf-field {width: 10%;} #q74 .cf-medium {width: 100%;} /* Purpose */ #q78 label {width: 90%;} #q78 .cf-field {width: 10%;} #q78 .cf-xlarge {width: 100%;} /* Miles Traveled */ #q76 label {width: 90%;} #q76 .cf-field {width: 10%;} #q76 .cf-medium {width: 75%;} /* Amount */ #q77 label {width: 90%;} #q77 .cf-field {width: 10%;} #q77 .cf-medium {width: 75%;}
I've been doing everything based on a percentage, rather than a firm pixel count, but if that's the only way to get it to work, so be it.
Thanks!