Welcome, Guest. Register Now!
   
Mark Forums Read Mark Forums Read Mark Forums Read


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 02-22-2008, 02:29 PM
Member
 
Join Date: Feb 2008
Posts: 46
Question Doubt on Zend_Form Style Change?

Hi,

I am using Form Class and designed the form fields and done the validation. But the problem is, alignment. When echo the form, it is taking "dt" & "dd" tag and the label and the fields are coming inside this tag. I want to remove this tag and want to put my tag. How to do this. I tried the addDecorator() function also. Can anyone tell me how to remove this tags and to put our own tags.?

-Mugesh.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-27-2008, 03:10 AM
Senior Member
 
Join Date: Jan 2008
Location: chicago
Posts: 101
Default

Quote:
Originally Posted by murugesanme View Post
Hi,

I am using Form Class and designed the form fields and done the validation. But the problem is, alignment. When echo the form, it is taking "dt" & "dd" tag and the label and the fields are coming inside this tag. I want to remove this tag and want to put my tag. How to do this. I tried the addDecorator() function also. Can anyone tell me how to remove this tags and to put our own tags.?

-Mugesh.
Did you figure this out? I know how to change this, but I would not recommend it. It's there for a reason and you can actually use it to your advantage with CSS code. I can tell you what CSS to use if you post a snippet of the HTML output.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 02-29-2008, 05:55 AM
Member
 
Join Date: Feb 2008
Posts: 46
Question

See here i am giving you a small HTML script for a login page. I hope you can understand the output of this code. So, what i need is, i want to design a large page to get nearly 40 values form the users . So, you can think the size of the form and the alignment. when i am using the Zend Form Class, i am not getting my required design output and the tags contains "dd" and "dt" . Instead of that i want to emmbed my entire form within a table and to display the lables and fields in separate TR,TD,s and Right side of each fields i want to add some commens about the field. I hope you understand my requirement.
- Give me a good solution.

HTML Code:
<FORM METHOD=POST ACTION="">
<TABLE>
<TR>
	<TD>User Name</TD>
	<TD><INPUT TYPE="text" NAME=""></TD>
</TR>
<TR>
	<TD>Password</TD>
	<TD><INPUT TYPE="text" NAME=""></TD>
</TR>
</TABLE>
</FORM>

- Thanks
-Mugesh
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 03-03-2008, 09:33 AM
Junior Member
 
Join Date: Mar 2008
Posts: 4
Default use decorators

Quote:
Originally Posted by murugesanme View Post
See here i am giving you a small HTML script for a login page. I hope you can understand the output of this code. So, what i need is, i want to design a large page to get nearly 40 values form the users . So, you can think the size of the form and the alignment. when i am using the Zend Form Class, i am not getting my required design output and the tags contains "dd" and "dt" . Instead of that i want to emmbed my entire form within a table and to display the lables and fields in separate TR,TD,s and Right side of each fields i want to add some commens about the field. I hope you understand my requirement.
- Give me a good solution.

HTML Code:
<FORM METHOD=POST ACTION="">
<TABLE>
<TR>
	<TD>User Name</TD>
	<TD><INPUT TYPE="text" NAME=""></TD>
</TR>
<TR>
	<TD>Password</TD>
	<TD><INPUT TYPE="text" NAME=""></TD>
</TR>
</TABLE>
</FORM>

- Thanks
-Mugesh

It is not recommended that you use table formatting unless you want to represent tabular data, but if you really want, it is possible. You should however keep in mind that the default decorators (dd and dt) seem to be used to place error messages inside the form, in case the form does not validate.

There are at least three ways for you to go:
1. Use css to align the dd and dt tags the way you want. I suggest you experiment with this before you do anything else
2. Remove all decorators by calling clearDecorators() on the form elements, but you will also not see the form element after that. The default decorators are View_Helper and Label. Discarding them all will leave you with a blank form. If you add the View_Helper decorater after the clearance you will see a form with unaligned elements (all on one line). You can now add html_tag decorators that you can initialize so that they will display td tags. They are relatively easy to work with.
3. Just add html_tag decorators to the decorator stack and leave the default decorators in place.

I hope this helps. If you don't get how the html_tag decorator works, it helps to look into the code in the library, it is very clearly written.

Bart McLeod
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 03-03-2008, 07:07 PM
Senior Member
 
Join Date: Jan 2008
Location: chicago
Posts: 101
Default

You can make DT and DD tags look like tables, it is very easy!
PHP Code:
dl {
    
margin0;
    
padding0;
    
width300px;
}

dtdd {
    
displayblock;
    
floatleft;
    
margin0;
    
padding0;
    
width150px;
}

dt {
    
clearleft;

try that out and tweak it to your liking.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 03-04-2008, 08:24 PM
Member
 
Join Date: Feb 2008
Posts: 46
Question

Thank you for your code. But still i have some doubt. I did not get the proper alignment. Ok let it be. Important thing is, if i want to give some note after the text box or something like eg: "[MM/DD/YYY]" i want to give at the side of any field. or "press ctrl+ to select more options".
So, these kind of informations i am not able to give now with ZF. Can you please tell me how to give these thing in a proper place.?

- Thanks

Mugesh.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 04:02 PM.