Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How To Align the Field Captions in a <CFFORM>

Status
Not open for further replies.

scripter73

Programmer
Joined
Apr 18, 2001
Messages
421
Location
US
Hi,

This one sounds like it should be easy. I just can't figure it out at the moment.

I have a form that allows a user to enter in a date range. You know the standard MM/DD/YYYY. I'm trying to align the captions MM DD YYYY under each box as appropriate. How can I do that? Should I use a table? However, in my <CFFORM>, I didn't use a table so now I'm not sure.

I know this thread sounds like it should be under HTML (basic fundamentals), but the <CFFORM> issue caused me to post it here.

Here's my code if you just want to paste it into your text editor real fast.


<html>
<head>
<title>Untitled</title>
<script language=&quot;javascript&quot;>
function show_value(){
alert(document.form1.month.value);
}
</script>
</head>

<body>
<cfform name=&quot;form1&quot; action=&quot;&quot; method=&quot;get&quot;>
<cfinput type=&quot;text&quot; name=&quot;startmonth&quot; value=&quot;02&quot; maxlength=2 size=3>
<cfinput type=&quot;text&quot; name=&quot;startday&quot; value=&quot;01&quot; maxlength=2 size=3>
<cfinput type=&quot;text&quot; name=&quot;startyear&quot; value=&quot;2002&quot; maxlength=4 size=5>
TO
<cfinput type=&quot;text&quot; name=&quot;endmonth&quot; value=&quot;02&quot; maxlength=2 size=3>
<cfinput type=&quot;text&quot; name=&quot;endday&quot; value=&quot;01&quot; maxlength=2 size=3>
<cfinput type=&quot;text&quot; name=&quot;endyear&quot; value=&quot;2002&quot; maxlength=4 size=5>

<input type=&quot;submit&quot; name=&quot;submit&quot; onclick=&quot;show_value();&quot;>

<br>
</cfform>

</body>
</html>



Thanks in advance for any help you can provide.

scripter73
Change Your Thinking, Change Your Life.
 
Yes, a table would work:

<cfform name=&quot;form1&quot; action=&quot;&quot; method=&quot;get&quot;>
[COLOR=008080]<TABLE>[/color]
[COLOR=008080]<TR>[/color]
[COLOR=008080]<TD>[/color]<cfinput type=&quot;text&quot; name=&quot;startmonth&quot; value=&quot;02&quot; maxlength=2 size=3>[COLOR=008080]</TD>[/color]
[COLOR=008080]<TD>[/color]<cfinput type=&quot;text&quot; name=&quot;startday&quot; value=&quot;01&quot; maxlength=2 size=3>[COLOR=008080]</TD>[/color]
[COLOR=008080]<TD>[/color]<cfinput type=&quot;text&quot; name=&quot;startyear&quot; value=&quot;2002&quot; maxlength=4 size=5>[COLOR=008080]</TD>[/color]
[COLOR=008080]<TD>[/color]TO[COLOR=008080]</TD>[/color]
[COLOR=008080]<TD>[/color]<cfinput type=&quot;text&quot; name=&quot;endmonth&quot; value=&quot;02&quot; maxlength=2 size=3>[COLOR=008080]</TD>[/color]
[COLOR=008080]<TD>[/color]<cfinput type=&quot;text&quot; name=&quot;endday&quot; value=&quot;01&quot; maxlength=2 size=3>[COLOR=008080]</TD>[/color]
[COLOR=008080]<TD>[/color]<cfinput type=&quot;text&quot; name=&quot;endyear&quot; value=&quot;2002&quot; maxlength=4 size=5>[COLOR=008080]</TD>[/color]
[COLOR=008080]<TD>[/color][COLOR=000080][COLOR=FA5000]<input type=&quot;submit&quot; name=&quot;submit&quot; onclick=&quot;show_value();&quot;>[/color][/color][COLOR=008080]</TD>[/color]
[COLOR=008080]</TR>[/color]
[COLOR=008080]<TR>[/color]
[COLOR=008080]<TD>[/color]MM[COLOR=008080]</TD>[/color]
[COLOR=008080]<TD>[/color]DD[COLOR=008080]</TD>[/color]
[COLOR=008080]<TD>[/color]YYYY[COLOR=008080]</TD>[/color]
[COLOR=008080]<TD>[/color] [COLOR=008080]</TD>[/color]
[COLOR=008080]<TD>[/color]MM[COLOR=008080]</TD>[/color]
[COLOR=008080]<TD>[/color]DD[COLOR=008080]</TD>[/color]
[COLOR=008080]<TD>[/color]YYYY[COLOR=008080]</TD>[/color]
[COLOR=008080]<TD>[/color] [COLOR=008080]</TD>[/color]
[COLOR=008080]</TR>[/color]
[COLOR=008080]</TABLE>[/color]
</cfform> - tleish
 
Hi tleish,

It worked like a charm! As usual, your code is perfect and you're the greatest.

Until next time..... ;-)

Thanks,
scripter73
Change Your Thinking, Change Your Life.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top