Forum Discussion
DavidMcFadyen
6 years agoQrew Member
Austin,
Thanks for the tips. Below is the field displaying and the code.
Field on form
Code
If([Payment Breakdown Choice] = "10,20,30,30,10",
"<table cellspacing=30>" &
"<tr><td>" & "<b>" & "10%" & "</b>" & "</td>" & "<td style='text-decoration: underline'>" & "<b>" & [10% Due Upon (Various)] & "</b>" & "</td>" & "<td>" & "due upon acceptance of proposal" & "</td> </tr><br /><br />" &
"<tr><td>" & "<b>" & "20%" & "</b>" & "</td>" & "<td style='text-decoration: underline'>" & "<b>" & [20% Due to Initiate] & "</td>" & "<td>" & "due to initiate project construction." & "</td> </tr><br /><br />" &
"<tr><td>" & "<b>" & "30%" & "</b>" & "</td>" & "<td style='text-decoration: underline'>" & "<b>" & [30% Due at 50%] & "</td>" & "<td>" & "due upon completion of 50% of the project construction." & "</td> </tr><br /><br />" &
"<tr><td>" & "<b>" & "30%" & "</b>" & "</td>" & "<td style='text-decoration: underline'>" & "<b>" & [30% Due at 90%] & "</td>" & "<td>" & "due upon completion of 90% of the project construction." & "</td> </tr><br /><br />" &
"<tr><td>" & "<b>" & "10%" & "</b>" & "</td>" & "<td style='text-decoration: underline'>" & "<b>" & [10% Due Upon (Various)] & "</td>" & "<td>" & "due upon project completion and approval/acceptance by the Owner." & "</td> </tr><br /><br />" &
"</table>", "This is a test.")
------------------------------
David McFadyen
------------------------------
Thanks for the tips. Below is the field displaying and the code.
Field on form
Code
If([Payment Breakdown Choice] = "10,20,30,30,10",
"<table cellspacing=30>" &
"<tr><td>" & "<b>" & "10%" & "</b>" & "</td>" & "<td style='text-decoration: underline'>" & "<b>" & [10% Due Upon (Various)] & "</b>" & "</td>" & "<td>" & "due upon acceptance of proposal" & "</td> </tr><br /><br />" &
"<tr><td>" & "<b>" & "20%" & "</b>" & "</td>" & "<td style='text-decoration: underline'>" & "<b>" & [20% Due to Initiate] & "</td>" & "<td>" & "due to initiate project construction." & "</td> </tr><br /><br />" &
"<tr><td>" & "<b>" & "30%" & "</b>" & "</td>" & "<td style='text-decoration: underline'>" & "<b>" & [30% Due at 50%] & "</td>" & "<td>" & "due upon completion of 50% of the project construction." & "</td> </tr><br /><br />" &
"<tr><td>" & "<b>" & "30%" & "</b>" & "</td>" & "<td style='text-decoration: underline'>" & "<b>" & [30% Due at 90%] & "</td>" & "<td>" & "due upon completion of 90% of the project construction." & "</td> </tr><br /><br />" &
"<tr><td>" & "<b>" & "10%" & "</b>" & "</td>" & "<td style='text-decoration: underline'>" & "<b>" & [10% Due Upon (Various)] & "</td>" & "<td>" & "due upon project completion and approval/acceptance by the Owner." & "</td> </tr><br /><br />" &
"</table>", "This is a test.")
------------------------------
David McFadyen
------------------------------
AustinK
6 years agoQrew Commander
The entire Rich Text field element in the dom has 10 line breaks in it above the code that you inserted into the field when using the above code. This is the hint at how to fix it because you also have 10 line breaks in your code. Remove those and just use the cell spacing or other styles to adjust the table and it should work for you. I just tested it myself.
- DavidMcFadyen6 years agoQrew MemberAustin,
Thanks for the tip. I am not trained in html so I just learn as I go. Are you saying to remove the line breaks from the code and that will fix it? How can you tell that there are 10 line breaks before the code?
------------------------------
David McFadyen
------------------------------- DavidMcFadyen6 years agoQrew MemberAustin,
Your suggestion worked. Thanks very much.
------------------------------
David McFadyen
------------------------------- AustinK6 years agoQrew CommanderThe way I could tell was I had to dive into it via the Chrome developer menu. I can show you a screenshot of what your code looked like in the dom. It won't be as valuable as if I could show you how to get there exactly but hopefully it helps some.
What I did was press F12 in chrome to open the dev menu and go to the Elements tab. You can hover over each line of html here and Chrome will highlight where it is used on the screen if it is visible to you. I hovered and checked until I found the container for all the fields on the form (the div has an ID of "mainBodyDiv".) Then rinse and repeat until you are down to the exact field you need.
There are another roughly 6+ layers above this that I had to go through to get here. You can see how your "<table cellspacing=30" code is beginning at the bottom. For some reason Quick Base just extracted all of your line breaks and put them above it.