- Moderated by:
- Support Team
-
- rank:
-
Professional
- registered:
- December 2002
- Status:
- offline
- last visit:
- 24.08.08
- Posts:
- 1588
Over the years I have hated the amount of HTML needed to display forms nicely and have always tried to cut down on the html/css needed. The code below is basically the latest incarnation of my efforts and I hope you find it useful - basically it gives a border to the form with lable on the left(aligned) and input on the right(aligned):
Code
<style>
/*to fix ie framset bug*/
.fsfix{border:0;padding:0;margin:0;}
.tar{text-align:right;}
.fl{float:left;}
</style>
<form action="index.php" method="get">
<input type="hidden" name="name" value="cmscart" />
<input type="hidden" name="type" value="admin" />
<fieldset><legend><strong><!--[pnml name=NVC_IMGSETTINGS]--></strong></legend>
<fieldset class="fsfix"><legend></legend></fieldset>
<div class="tar">
<span class="fl"><label for="enable"><!--[pnml name=NVC_WMENABLE]--></label></span>
<span><input name="enable" type="text" value="<!--[$wmdata.enable]-->" /></span>
</div>
<div class="tar">
<span class="fl"><label for="enable"><!--[pnml name=NVC_WMENABLE]--></label></span>
<span><input name="enable" type="text" value="<!--[$wmdata.enable]-->" /></span>
</div>
<div class="tar">
<span class="fl"><!--[pnml name=NVC_WMENABLE]--></label></span>
<span><input name="enable" type="text" value="<!--[$wmdata.enable]-->" /></span>
</div>
<div class="tar">
<span class="fl"><label for="enable"><!--[pnml name=NVC_WMENABLE]--></label></span>
<span><input name="enable" type="text" value="<!--[$wmdata.enable]-->" /></span>
</div>
<input type="submit" name="isupate" value="<!--[pnml name=NVC_UPDATE]-->">
</fieldset>
</form>
-Lobos
--
-Lobos
Professional PHP Framework Services: Concept, Development and Deployment -
- rank:
-
Professional
- registered:
- March 2003
- Status:
- offline
- last visit:
- 13.08.06
- Posts:
- 1185
Great job Lobos! It's worth pointing out, for novices at least, that the classes in your example must be defined elsewhere- usually in Cascading Style Sheets (CSS). The form will work without CSS definitions but no "style" will be applied to the elements. Slugger
