Hello,
I’m trying to figure out the proper way to align fields on a form.
I have attached a screen shot of how I want them to lay out.
So far, this is the only code I can get to work, but it’s a kludge:
{type:“settings”,labelAlign:“right”,labelWidth:75},
{type:“input”, name:“address”, label:“Address:”,maxLength:40, inputWidth:200},
{type:“input”, name:“city”, label:“City:”},
{type: “block”, list: [
{type:“input”, name:“state”, label:“State:”, labelWidth:55, maxLength:2, inputWidth:20},
{type: “newcolumn”},
{type:“input”, name:“zipcode”, label:“Zipcode:”,maxLength:5, inputWidth:50}
]},
{type: “calendar”, dateFormat: “%Y-%m-%d”, serverDateFormat: “%Y-%m-%d”,name: “dob”, label: “Birthdate:”, offsetTop:30, maxLength:10, inputWidth:70}
Notice, I had to fiddle with the label width of the block of fields for the state and zipcode, because the BLOCK type has a left padding or offset of what looks to be 20 pixels, so I have to deduct that 20 from the normal label width of 75.
Is there a way to get blocks to have no padding in them? They don’t appear to have any top and bottom padding , but they do have a left and right padding, that again, looks like it’s 20 px.
Jimmying the labelWidth like that on an inner block makes maintenance of the code difficult, because if the developers ever change the padding on blocks, or if somebody wants to change the label width for the entire page, then this special short label will have to be adjusted by hand by the coder.
Any ideas?
John Pittman Hey