Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6557997
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T13:08:40+00:00 2026-05-25T13:08:40+00:00

I have a form build with zend using a viewscript. I thought that by

  • 0

I have a form build with zend using a viewscript. I thought that by using a viewscript I’d get all the dd and dt eliminated and be able to use my own html tags on the form of the form script file (patientScriptForm.phtml)?

How do I use only the div tags in my form script file and not auto-generated dt and dd tags? Thanks!!

I have a very basic form with code below:

$age = new Zend_Form_Element_Text('age'); $age->setLabel('age');

$submit = new Zend_Form_Element_Submit('submit'); $submit->setValue($submit);

$this->addElement($age)->addElement($submit); 

$this->setDecorators(array ( array ('ViewScript',    array('viewScript' => 'patientScriptForm.phtml'))));

Below is my viewscript patientScriptForm.phtml

<form action="<?php echo $this->escape($this->element->getAction()) ?>" method="<?php echo $this->escape($this->element->getMethod()) ?>"> 
<div> 
<?php echo $this->element->age ?>
</div> 
<div>
<?php echo $this->element->submit ?>
</div> 
</form>

Below is the browser output:

<form action="" method="post"> 
<div> 
<dt id="age-label">
<label for="age" class="optional">age</label>
</dt> 
<dd id="age-element"> 
<input type="text" name="age" id="age" value="" />
</dd>
</div> 
<div>
<dt id="submit-label"> 
</dt>
<dd id="submit-element"> 
<input type="submit" name="submit" id="submit" value="submit" />
</dd>
</div> 
</form>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T13:08:40+00:00Added an answer on May 25, 2026 at 1:08 pm

    The problem is that whilst using the ViewScript decorator for the form works for the form element itself, your elements each have their own default decorator scheme.

    A simple solution in your view script could be

    <?php echo $this->element->age->setDecorators(array('ViewHelper')) ?>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Form Build your own MVVM I have the following code that lets us have
I'm trying to build a web app using Dojo. I have a form that
I'm using jQTouch to build a simple mobile app with an html/js/jquery form that
I have a bit of data that I want to use to build a
So I have a form that I want the user to use to update
I have built a zend form element for html content (general notes). class Sistema_Form_Note
I have a form in Magento that I build in code, and that works
I have a contact form that is build in arabic language. When it is
Every time I have to build a form with a DateTime field I try
I need to build a form where I have 2 comboBoxes . Select country

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.