Changing the size attribute of a validationtextbox element

classic Classic list List threaded Threaded
14 messages Options
Reply | Threaded
Open this post in threaded view
|

Changing the size attribute of a validationtextbox element

Andrew Sledge
Hello all,

This is in relation to Zend_Form.  Apparently I'm missing the obvious, but how do you change the size attribute of a ValidationTextbox element?

Here is my element

$this->addElement('ValidationTextBox', 'name', array(
'label'      => 'Name:',
'required'   => true,
'filters'    => array('StringTrim'),
'regExp' => $regex,            
'validators' => array(
array('Regex',false,array('/^'.$regex.'$/'))
),
'decorators' => array(
array('DijitElement', array('maxlength' => 1)),
'Errors',
array('HtmlTag', array('tag' => 'div')),
array('Label', array('tag' => 'div')),
array('Description', array('tag' => 'div')),
),
));

I want the input element to have the size attribute to have 8.  Any and all help is most appreciated.

--
Andrew Sledge
Reply | Threaded
Open this post in threaded view
|

Re: Changing the size attribute of a validationtextbox element

J DeBord

On Fri, Nov 13, 2009 at 4:33 AM, Andrew Sledge <[hidden email]> wrote:
Hello all,

This is in relation to Zend_Form.  Apparently I'm missing the obvious, but how do you change the size attribute of a ValidationTextbox element?

$this->addElement('ValidationTextBox', 'name', array(

        'label'      => 'Name:',

        'size' => 8,

        'required'   => true,

        'filters'    => array('StringTrim'),

        'regExp' => $regex,

        'validators' => array(

            array('Regex',false,array('/^'.$regex.'$/'))

        ),
Here is my element

$this->addElement('ValidationTextBox', 'name', array(
'label'      => 'Name:',
'required'   => true,
'filters'    => array('StringTrim'),
'regExp' => $regex,            
'validators' => array(
array('Regex',false,array('/^'.$regex.'$/'))
),
'decorators' => array(
array('DijitElement', array('maxlength' => 1)),
'Errors',
array('HtmlTag', array('tag' => 'div')),
array('Label', array('tag' => 'div')),
array('Description', array('tag' => 'div')),
),
));

I want the input element to have the size attribute to have 8.  Any and all help is most appreciated.

--
Andrew Sledge

Reply | Threaded
Open this post in threaded view
|

Re: Changing the size attribute of a validationtextbox element

Andrew Sledge
Unfortunately, this doesn't work.  I've tried applying options size, max, maximum, and maxlength with no desirable outcome.

On Fri, Nov 13, 2009 at 6:23 AM, J DeBord <[hidden email]> wrote:

On Fri, Nov 13, 2009 at 4:33 AM, Andrew Sledge <[hidden email]> wrote:
Hello all,

This is in relation to Zend_Form.  Apparently I'm missing the obvious, but how do you change the size attribute of a ValidationTextbox element?

$this->addElement('ValidationTextBox', 'name', array(

        'label'      => 'Name:',

        'size' => 8,


        'required'   => true,

        'filters'    => array('StringTrim'),

        'regExp' => $regex,

        'validators' => array(

            array('Regex',false,array('/^'.$regex.'$/'))

        ),
Here is my element

$this->addElement('ValidationTextBox', 'name', array(
'label'      => 'Name:',
'required'   => true,
'filters'    => array('StringTrim'),
'regExp' => $regex,            
'validators' => array(
array('Regex',false,array('/^'.$regex.'$/'))
),
'decorators' => array(
array('DijitElement', array('maxlength' => 1)),
'Errors',
array('HtmlTag', array('tag' => 'div')),
array('Label', array('tag' => 'div')),
array('Description', array('tag' => 'div')),
),
));

I want the input element to have the size attribute to have 8.  Any and all help is most appreciated.

--
Andrew Sledge




--
Andrew Sledge
Reply | Threaded
Open this post in threaded view
|

Re: Changing the size attribute of a validationtextbox element

Wouter de Gooijer
Try this:

$this->addElement('ValidationTextBox', 'name', array(

        'label'      => 'Name:',

                   
'attribs'     => array(
                'size' => 8,
                'maxLength' => 8,
           ),


        'required'   => true,

        'filters'    => array('StringTrim'),

        'regExp' => $regex,

        'validators' => array(

            array('Regex',false,array('/^'.$regex.'$/'))

        ),


On Fri, Nov 13, 2009 at 15:06, Andrew Sledge <[hidden email]> wrote:
Unfortunately, this doesn't work.  I've tried applying options size, max, maximum, and maxlength with no desirable outcome.


On Fri, Nov 13, 2009 at 6:23 AM, J DeBord <[hidden email]> wrote:

On Fri, Nov 13, 2009 at 4:33 AM, Andrew Sledge <[hidden email]> wrote:
Hello all,

This is in relation to Zend_Form.  Apparently I'm missing the obvious, but how do you change the size attribute of a ValidationTextbox element?

$this->addElement('ValidationTextBox', 'name', array(

        'label'      => 'Name:',

        'size' => 8,


        'required'   => true,

        'filters'    => array('StringTrim'),

        'regExp' => $regex,

        'validators' => array(

            array('Regex',false,array('/^'.$regex.'$/'))

        ),
Here is my element

$this->addElement('ValidationTextBox', 'name', array(
'label'      => 'Name:',
'required'   => true,
'filters'    => array('StringTrim'),
'regExp' => $regex,            
'validators' => array(
array('Regex',false,array('/^'.$regex.'$/'))
),
'decorators' => array(
array('DijitElement', array('maxlength' => 1)),
'Errors',
array('HtmlTag', array('tag' => 'div')),
array('Label', array('tag' => 'div')),
array('Description', array('tag' => 'div')),
),
));

I want the input element to have the size attribute to have 8.  Any and all help is most appreciated.

--
Andrew Sledge


--
Andrew Sledge

Yours,

Wouter de Gooijer
Reply | Threaded
Open this post in threaded view
|

Re: Changing the size attribute of a validationtextbox element

Andrew Sledge
Alas, still no.  At this point I think I've tried just about every combination possible.

On Fri, Nov 13, 2009 at 9:27 AM, Wouter de Gooijer <[hidden email]> wrote:
Try this:

$this->addElement('ValidationTextBox', 'name', array(

        'label'      => 'Name:',

                   
'attribs'     => array(
                'size' => 8,
                'maxLength' => 8,
           ),


        'required'   => true,

        'filters'    => array('StringTrim'),

        'regExp' => $regex,

        'validators' => array(

            array('Regex',false,array('/^'.$regex.'$/'))

        ),


On Fri, Nov 13, 2009 at 15:06, Andrew Sledge <[hidden email]> wrote:
Unfortunately, this doesn't work.  I've tried applying options size, max, maximum, and maxlength with no desirable outcome.


On Fri, Nov 13, 2009 at 6:23 AM, J DeBord <[hidden email]> wrote:

On Fri, Nov 13, 2009 at 4:33 AM, Andrew Sledge <[hidden email]> wrote:
Hello all,

This is in relation to Zend_Form.  Apparently I'm missing the obvious, but how do you change the size attribute of a ValidationTextbox element?

$this->addElement('ValidationTextBox', 'name', array(

        'label'      => 'Name:',

        'size' => 8,


        'required'   => true,

        'filters'    => array('StringTrim'),

        'regExp' => $regex,

        'validators' => array(

            array('Regex',false,array('/^'.$regex.'$/'))

        ),
Here is my element

$this->addElement('ValidationTextBox', 'name', array(
'label'      => 'Name:',
'required'   => true,
'filters'    => array('StringTrim'),
'regExp' => $regex,            
'validators' => array(
array('Regex',false,array('/^'.$regex.'$/'))
),
'decorators' => array(
array('DijitElement', array('maxlength' => 1)),
'Errors',
array('HtmlTag', array('tag' => 'div')),
array('Label', array('tag' => 'div')),
array('Description', array('tag' => 'div')),
),
));

I want the input element to have the size attribute to have 8.  Any and all help is most appreciated.

--
Andrew Sledge


--
Andrew Sledge

Yours,

Wouter de Gooijer



--
Andrew Sledge
Reply | Threaded
Open this post in threaded view
|

Re: Changing the size attribute of a validationtextbox element

Rob Keplin
I have something like this, which works:

$this->addElement(
            'ValidationTextBox',
            'zip_code',
            array(
                'label'        => 'Zip Code',
                'trim'        => true,
                'maxLength' => 5,
                'required'    => true,
                'regExp'    => '^[0-9]{5,5}$',
                'invalidMessage' => 'Valid Zip Code Required. Ex: 90210'
            )
        );


Andrew Sledge wrote:
Alas, still no.  At this point I think I've tried just about every combination possible.

On Fri, Nov 13, 2009 at 9:27 AM, Wouter de Gooijer <[hidden email]> wrote:
Try this:

$this->addElement('ValidationTextBox', 'name', array(

        'label'      => 'Name:',

                   
'attribs'     => array(
                'size' => 8,
                'maxLength' => 8,
           ),


        'required'   => true,

        'filters'    => array('StringTrim'),

        'regExp' => $regex,

        'validators' => array(

            array('Regex',false,array('/^'.$regex.'$/'))

        ),


On Fri, Nov 13, 2009 at 15:06, Andrew Sledge <[hidden email]> wrote:
Unfortunately, this doesn't work.  I've tried applying options size, max, maximum, and maxlength with no desirable outcome.


On Fri, Nov 13, 2009 at 6:23 AM, J DeBord <[hidden email]> wrote:

On Fri, Nov 13, 2009 at 4:33 AM, Andrew Sledge <[hidden email]> wrote:
Hello all,

This is in relation to Zend_Form.  Apparently I'm missing the obvious, but how do you change the size attribute of a ValidationTextbox element?

$this->addElement('ValidationTextBox', 'name', array(

        'label'      => 'Name:',

        'size' => 8,


        'required'   => true,

        'filters'    => array('StringTrim'),

        'regExp' => $regex,

        'validators' => array(

            array('Regex',false,array('/^'.$regex.'$/'))

        ),
Here is my element

$this->addElement('ValidationTextBox', 'name', array(
'label'      => 'Name:',
'required'   => true,
'filters'    => array('StringTrim'),
'regExp' => $regex,            
'validators' => array(
array('Regex',false,array('/^'.$regex.'$/'))
),
'decorators' => array(
array('DijitElement', array('maxlength' => 1)),
'Errors',
array('HtmlTag', array('tag' => 'div')),
array('Label', array('tag' => 'div')),
array('Description', array('tag' => 'div')),
),
));

I want the input element to have the size attribute to have 8.  Any and all help is most appreciated.

--
Andrew Sledge


--
Andrew Sledge

Yours,

Wouter de Gooijer



--
Andrew Sledge
Reply | Threaded
Open this post in threaded view
|

Re: Changing the size attribute of a validationtextbox element

Andrew Sledge
That still did not work.  Maybe it's something to do with my configuration:

Zend Server CE running locally
Zend Studio 7.0.2
PHP 5.2.6
Zend Framework 1.9.0 (r17310)

Is there another alternative, such as applying a decorator to this object?  If so, which decorator would allow me to change the styling on this particular object?

On Fri, Nov 13, 2009 at 10:07 AM, Rob Keplin <[hidden email]> wrote:
I have something like this, which works:

$this->addElement(
            'ValidationTextBox',
            'zip_code',
            array(
                'label'        => 'Zip Code',
                'trim'        => true,
                'maxLength' => 5,
                'required'    => true,
                'regExp'    => '^[0-9]{5,5}$',
                'invalidMessage' => 'Valid Zip Code Required. Ex: 90210'
            )
        );



Andrew Sledge wrote:
Alas, still no.  At this point I think I've tried just about every combination possible.

On Fri, Nov 13, 2009 at 9:27 AM, Wouter de Gooijer <[hidden email]> wrote:
Try this:

$this->addElement('ValidationTextBox', 'name', array(

        'label'      => 'Name:',

                   
'attribs'     => array(
                'size' => 8,
                'maxLength' => 8,
           ),


        'required'   => true,

        'filters'    => array('StringTrim'),

        'regExp' => $regex,

        'validators' => array(

            array('Regex',false,array('/^'.$regex.'$/'))

        ),


On Fri, Nov 13, 2009 at 15:06, Andrew Sledge <[hidden email]> wrote:
Unfortunately, this doesn't work.  I've tried applying options size, max, maximum, and maxlength with no desirable outcome.


On Fri, Nov 13, 2009 at 6:23 AM, J DeBord <[hidden email]> wrote:

On Fri, Nov 13, 2009 at 4:33 AM, Andrew Sledge <[hidden email]> wrote:
Hello all,

This is in relation to Zend_Form.  Apparently I'm missing the obvious, but how do you change the size attribute of a ValidationTextbox element?

$this->addElement('ValidationTextBox', 'name', array(

        'label'      => 'Name:',

        'size' => 8,


        'required'   => true,

        'filters'    => array('StringTrim'),

        'regExp' => $regex,

        'validators' => array(

            array('Regex',false,array('/^'.$regex.'$/'))

        ),
Here is my element

$this->addElement('ValidationTextBox', 'name', array(
'label'      => 'Name:',
'required'   => true,
'filters'    => array('StringTrim'),
'regExp' => $regex,            
'validators' => array(
array('Regex',false,array('/^'.$regex.'$/'))
),
'decorators' => array(
array('DijitElement', array('maxlength' => 1)),
'Errors',
array('HtmlTag', array('tag' => 'div')),
array('Label', array('tag' => 'div')),
array('Description', array('tag' => 'div')),
),
));

I want the input element to have the size attribute to have 8.  Any and all help is most appreciated.

--
Andrew Sledge


--
Andrew Sledge

Yours,

Wouter de Gooijer



--
Andrew Sledge



--
Andrew Sledge
Reply | Threaded
Open this post in threaded view
|

RE: Changing the size attribute of a validationtextbox element

amtdev

Try this format:

 

// add element: zip textbox

      $zip = $this->createElement('text', 'zip_code');

      $zip->setLabel('Zip Code:');

      $zip->setRequired(true);

      $zip->setAttrib('size', 30);

      // Etc., etc.

      $this->addElement($zip); 

 


From: Andrew Sledge [mailto:[hidden email]]
Sent: Friday, November 13, 2009 10:50 AM
To: [hidden email]
Subject: Re: [fw-mvc] Changing the size attribute of a validationtextbox element

 

That still did not work.  Maybe it's something to do with my configuration:

 

Zend Server CE running locally

Zend Studio 7.0.2

PHP 5.2.6

Zend Framework 1.9.0 (r17310)

 

Is there another alternative, such as applying a decorator to this object?  If so, which decorator would allow me to change the styling on this particular object?

On Fri, Nov 13, 2009 at 10:07 AM, Rob Keplin <[hidden email]> wrote:

I have something like this, which works:

$this->addElement(
            'ValidationTextBox',
            'zip_code',
            array(
                'label'        => 'Zip Code',
                'trim'        => true,
                'maxLength' => 5,
                'required'    => true,
                'regExp'    => '^[0-9]{5,5}$',
                'invalidMessage' => 'Valid Zip Code Required. Ex: 90210'
            )
        );




Andrew Sledge wrote:

Alas, still no.  At this point I think I've tried just about every combination possible.

On Fri, Nov 13, 2009 at 9:27 AM, Wouter de Gooijer <[hidden email]> wrote:

Try this:

$this->addElement('ValidationTextBox', 'name', array(

        'label'      => 'Name:',

                   

'attribs'     => array(

                'size' => 8,
                'maxLength' => 8,
           ),


        'required'   => true,

        'filters'    => array('StringTrim'),

        'regExp' => $regex,

        'validators' => array(

            array('Regex',false,array('/^'.$regex.'$/'))


        ),

 

On Fri, Nov 13, 2009 at 15:06, Andrew Sledge <[hidden email]> wrote:

Unfortunately, this doesn't work.  I've tried applying options size, max, maximum, and maxlength with no desirable outcome.

 

On Fri, Nov 13, 2009 at 6:23 AM, J DeBord <[hidden email]> wrote:

 

On Fri, Nov 13, 2009 at 4:33 AM, Andrew Sledge <[hidden email]> wrote:

Hello all,

 

This is in relation to Zend_Form.  Apparently I'm missing the obvious, but how do you change the size attribute of a ValidationTextbox element?

 

$this->addElement('ValidationTextBox', 'name', array(

        'label'      => 'Name:',

        'size' => 8,



        'required'   => true,

        'filters'    => array('StringTrim'),

        'regExp' => $regex,

        'validators' => array(

            array('Regex',false,array('/^'.$regex.'$/'))

        ),

Here is my element

 

$this->addElement('ValidationTextBox', 'name', array(

'label'      => 'Name:',

'required'   => true,

'filters'    => array('StringTrim'),

'regExp' => $regex,            

'validators' => array(

array('Regex',false,array('/^'.$regex.'$/'))

),

'decorators' => array(

array('DijitElement', array('maxlength' => 1)),

'Errors',

array('HtmlTag', array('tag' => 'div')),

array('Label', array('tag' => 'div')),

array('Description', array('tag' => 'div')),

),

));

 

I want the input element to have the size attribute to have 8.  Any and all help is most appreciated.


--
Andrew Sledge

 

 

--
Andrew Sledge


Yours,

Wouter de Gooijer




--
Andrew Sledge




--
Andrew Sledge

Reply | Threaded
Open this post in threaded view
|

Re: Changing the size attribute of a validationtextbox element

sNop
In reply to this post by Andrew Sledge
Andrew Sledge napsal(a):
Hello all,

This is in relation to Zend_Form.  Apparently I'm missing the obvious, but how do you change the size attribute of a ValidationTextbox element?

Here is my element

$this->addElement('ValidationTextBox', 'name', array(
'label'      => 'Name:',
'required'   => true,
'filters'    => array('StringTrim'),
'regExp' => $regex,            
'validators' => array(
array('Regex',false,array('/^'.$regex.'$/'))
),
'decorators' => array(
array('DijitElement', array('maxlength' => 1)),
'Errors',
array('HtmlTag', array('tag' => 'div')),
array('Label', array('tag' => 'div')),
array('Description', array('tag' => 'div')),
),
));

I want the input element to have the size attribute to have 8.  Any and all help is most appreciated.

--
Andrew Sledge
$this->addElement('ValidationTextBox', 'name', array(
'label'      => 'Name:',
'required'   => true,
'filters'    => array('StringTrim'),
'regExp' => $regex,            
'validators' => array(
array('Regex',false,array('/^'.$regex.'$/'))
),
'decorators' => array(
array('DijitElement', array('maxlength' => 1)),
'Errors',
array('HtmlTag', array('tag' => 'div')),
array('Label', array('tag' => 'div')),
array('Description', array('tag' => 'div')),
),
'dijitParams' => array(
    maxLength => 8
),
'style' => 'width: 100px'
));

Dijit ValidationTextBox doesn't support size, you can setup CSS with property

signature.asc (267 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Changing the size attribute of a validationtextbox element

J DeBord
In reply to this post by amtdev
This:

<?php

class Form_Test extends Zend_Dojo_Form {

public function init()
{
$this->addElement('ValidationTextBox', 'name', array(
'label' => 'Name:',
'required' => true,
'size' => 8,
'filters' => array('StringTrim'),
'validators' => array(
),
'decorators' => array(
array('DijitElement', array('maxlength' => 1)),
'Errors',
array('HtmlTag', array('tag' => 'div')),
array('Label', array('tag' => 'div')),
array('Description', array('tag' => 'div')),
),

));
}
}

Outputs this:

<form><dl class="zend_form_dojo">
<div id="name-label"><label for="name" class="required">Name:</label></div>
<div>
<input size="8" id="name" name="name" value="" type="text"></div></dl></form>
I'm using 5.2.11 and ZF 1.9.5

Jason DEBORD
Zend Certified Engineer

http://www.jasondebord.net
http://www.nobrandapp.com


On Fri, Nov 13, 2009 at 5:23 PM, amtdev <[hidden email]> wrote:

Try this format:

 

// add element: zip textbox

      $zip = $this->createElement('text', 'zip_code');

      $zip->setLabel('Zip Code:');

      $zip->setRequired(true);

      $zip->setAttrib('size', 30);

      // Etc., etc.

      $this->addElement($zip); 

 


From: Andrew Sledge [mailto:[hidden email]]
Sent: Friday, November 13, 2009 10:50 AM
To: [hidden email]
Subject: Re: [fw-mvc] Changing the size attribute of a validationtextbox element

 

That still did not work.  Maybe it's something to do with my configuration:

 

Zend Server CE running locally

Zend Studio 7.0.2

PHP 5.2.6

Zend Framework 1.9.0 (r17310)

 

Is there another alternative, such as applying a decorator to this object?  If so, which decorator would allow me to change the styling on this particular object?

On Fri, Nov 13, 2009 at 10:07 AM, Rob Keplin <[hidden email]> wrote:

I have something like this, which works:

$this->addElement(
            'ValidationTextBox',
            'zip_code',
            array(
                'label'        => 'Zip Code',
                'trim'        => true,
                'maxLength' => 5,
                'required'    => true,
                'regExp'    => '^[0-9]{5,5}$',
                'invalidMessage' => 'Valid Zip Code Required. Ex: 90210'
            )
        );




Andrew Sledge wrote:

Alas, still no.  At this point I think I've tried just about every combination possible.

On Fri, Nov 13, 2009 at 9:27 AM, Wouter de Gooijer <[hidden email]> wrote:

Try this:

$this->addElement('ValidationTextBox', 'name', array(

        'label'      => 'Name:',

                   

'attribs'     => array(

                'size' => 8,
                'maxLength' => 8,
           ),


        'required'   => true,

        'filters'    => array('StringTrim'),

        'regExp' => $regex,

        'validators' => array(

            array('Regex',false,array('/^'.$regex.'$/'))


        ),

 

On Fri, Nov 13, 2009 at 15:06, Andrew Sledge <[hidden email]> wrote:

Unfortunately, this doesn't work.  I've tried applying options size, max, maximum, and maxlength with no desirable outcome.

 

On Fri, Nov 13, 2009 at 6:23 AM, J DeBord <[hidden email]> wrote:

 

On Fri, Nov 13, 2009 at 4:33 AM, Andrew Sledge <[hidden email]> wrote:

Hello all,

 

This is in relation to Zend_Form.  Apparently I'm missing the obvious, but how do you change the size attribute of a ValidationTextbox element?

 

$this->addElement('ValidationTextBox', 'name', array(

        'label'      => 'Name:',

        'size' => 8,



        'required'   => true,

        'filters'    => array('StringTrim'),

        'regExp' => $regex,

        'validators' => array(

            array('Regex',false,array('/^'.$regex.'$/'))

        ),

Here is my element

 

$this->addElement('ValidationTextBox', 'name', array(

'label'      => 'Name:',

'required'   => true,

'filters'    => array('StringTrim'),

'regExp' => $regex,            

'validators' => array(

array('Regex',false,array('/^'.$regex.'$/'))

),

'decorators' => array(

array('DijitElement', array('maxlength' => 1)),

'Errors',

array('HtmlTag', array('tag' => 'div')),

array('Label', array('tag' => 'div')),

array('Description', array('tag' => 'div')),

),

));

 

I want the input element to have the size attribute to have 8.  Any and all help is most appreciated.


--
Andrew Sledge

 

 

--
Andrew Sledge


Yours,

Wouter de Gooijer




--
Andrew Sledge




--
Andrew Sledge


Reply | Threaded
Open this post in threaded view
|

Re: Changing the size attribute of a validationtextbox element

Andrew Sledge
When I tried this, I get 

<input type="text" name="name" autocomplete="off" dojoattachpoint="textbox,focusNode" class="dijitReset" aria-invalid="true" id="weight" tabindex="0" aria-required="true" value="" required="true" dojotype="dijit.form.ValidationTextBox"/>

I don't know what the difference is.

On Fri, Nov 13, 2009 at 11:57 AM, J DeBord <[hidden email]> wrote:
This:

<?php

class Form_Test extends Zend_Dojo_Form {

public function init()

{
$this->addElement('ValidationTextBox', 'name', array(
'label' => 'Name:',
'required' => true,
'size' => 8,
'filters' => array('StringTrim'),
'validators' => array(

),
'decorators' => array(
array('DijitElement', array('maxlength' => 1)),
'Errors',
array('HtmlTag', array('tag' => 'div')),
array('Label', array('tag' => 'div')),
array('Description', array('tag' => 'div')),
),

));
}
}

Outputs this:

<form><dl class="zend_form_dojo">
<div id="name-label"><label for="name" class="required">Name:</label></div>
<div>
<input size="8" id="name" name="name" value="" type="text"></div></dl></form>
I'm using 5.2.11 and ZF 1.9.5

Jason DEBORD
Zend Certified Engineer

http://www.jasondebord.net
http://www.nobrandapp.com



On Fri, Nov 13, 2009 at 5:23 PM, amtdev <[hidden email]> wrote:

Try this format:

 

// add element: zip textbox

      $zip = $this->createElement('text', 'zip_code');

      $zip->setLabel('Zip Code:');

      $zip->setRequired(true);

      $zip->setAttrib('size', 30);

      // Etc., etc.

      $this->addElement($zip); 

 


From: Andrew Sledge [mailto:[hidden email]]
Sent: Friday, November 13, 2009 10:50 AM
To: [hidden email]
Subject: Re: [fw-mvc] Changing the size attribute of a validationtextbox element

 

That still did not work.  Maybe it's something to do with my configuration:

 

Zend Server CE running locally

Zend Studio 7.0.2

PHP 5.2.6

Zend Framework 1.9.0 (r17310)

 

Is there another alternative, such as applying a decorator to this object?  If so, which decorator would allow me to change the styling on this particular object?

On Fri, Nov 13, 2009 at 10:07 AM, Rob Keplin <[hidden email]> wrote:

I have something like this, which works:

$this->addElement(
            'ValidationTextBox',
            'zip_code',
            array(
                'label'        => 'Zip Code',
                'trim'        => true,
                'maxLength' => 5,
                'required'    => true,
                'regExp'    => '^[0-9]{5,5}$',
                'invalidMessage' => 'Valid Zip Code Required. Ex: 90210'
            )
        );




Andrew Sledge wrote:

Alas, still no.  At this point I think I've tried just about every combination possible.

On Fri, Nov 13, 2009 at 9:27 AM, Wouter de Gooijer <[hidden email]> wrote:

Try this:

$this->addElement('ValidationTextBox', 'name', array(

        'label'      => 'Name:',

                   

'attribs'     => array(

                'size' => 8,
                'maxLength' => 8,
           ),


        'required'   => true,

        'filters'    => array('StringTrim'),

        'regExp' => $regex,

        'validators' => array(

            array('Regex',false,array('/^'.$regex.'$/'))


        ),

 

On Fri, Nov 13, 2009 at 15:06, Andrew Sledge <[hidden email]> wrote:

Unfortunately, this doesn't work.  I've tried applying options size, max, maximum, and maxlength with no desirable outcome.

 

On Fri, Nov 13, 2009 at 6:23 AM, J DeBord <[hidden email]> wrote:

 

On Fri, Nov 13, 2009 at 4:33 AM, Andrew Sledge <[hidden email]> wrote:

Hello all,

 

This is in relation to Zend_Form.  Apparently I'm missing the obvious, but how do you change the size attribute of a ValidationTextbox element?

 

$this->addElement('ValidationTextBox', 'name', array(

        'label'      => 'Name:',

        'size' => 8,



        'required'   => true,

        'filters'    => array('StringTrim'),

        'regExp' => $regex,

        'validators' => array(

            array('Regex',false,array('/^'.$regex.'$/'))

        ),

Here is my element

 

$this->addElement('ValidationTextBox', 'name', array(

'label'      => 'Name:',

'required'   => true,

'filters'    => array('StringTrim'),

'regExp' => $regex,            

'validators' => array(

array('Regex',false,array('/^'.$regex.'$/'))

),

'decorators' => array(

array('DijitElement', array('maxlength' => 1)),

'Errors',

array('HtmlTag', array('tag' => 'div')),

array('Label', array('tag' => 'div')),

array('Description', array('tag' => 'div')),

),

));

 

I want the input element to have the size attribute to have 8.  Any and all help is most appreciated.


--
Andrew Sledge

 

 

--
Andrew Sledge


Yours,

Wouter de Gooijer




--
Andrew Sledge




--
Andrew Sledge





--
Andrew Sledge
Reply | Threaded
Open this post in threaded view
|

Re: Changing the size attribute of a validationtextbox element

J DeBord

On Fri, Nov 13, 2009 at 6:13 PM, Andrew Sledge <[hidden email]> wrote:
When I tried this, I get 

<input type="text" name="name" autocomplete="off" dojoattachpoint="textbox,focusNode" class="dijitReset" aria-invalid="true" id="weight" tabindex="0" aria-required="true" value="" required="true" dojotype="dijit.form.ValidationTextBox"/>

I don't know what the difference is.

You tried the code exactly as I wrote it? If so, hopefully someone smarter than us can figure it out. Good luck.
 
On Fri, Nov 13, 2009 at 11:57 AM, J DeBord <[hidden email]> wrote:
This:

<?php

class Form_Test extends Zend_Dojo_Form {

public function init()

{
$this->addElement('ValidationTextBox', 'name', array(
'label' => 'Name:',
'required' => true,
'size' => 8,
'filters' => array('StringTrim'),
'validators' => array(

),
'decorators' => array(
array('DijitElement', array('maxlength' => 1)),
'Errors',
array('HtmlTag', array('tag' => 'div')),
array('Label', array('tag' => 'div')),
array('Description', array('tag' => 'div')),
),

));
}
}

Outputs this:

<form><dl class="zend_form_dojo">
<div id="name-label"><label for="name" class="required">Name:</label></div>
<div>
<input size="8" id="name" name="name" value="" type="text"></div></dl></form>
I'm using 5.2.11 and ZF 1.9.5

Jason DEBORD
Zend Certified Engineer

http://www.jasondebord.net
http://www.nobrandapp.com



On Fri, Nov 13, 2009 at 5:23 PM, amtdev <[hidden email]> wrote:

Try this format:

 

// add element: zip textbox

      $zip = $this->createElement('text', 'zip_code');

      $zip->setLabel('Zip Code:');

      $zip->setRequired(true);

      $zip->setAttrib('size', 30);

      // Etc., etc.

      $this->addElement($zip); 

 


From: Andrew Sledge [mailto:[hidden email]]
Sent: Friday, November 13, 2009 10:50 AM
To: [hidden email]
Subject: Re: [fw-mvc] Changing the size attribute of a validationtextbox element

 

That still did not work.  Maybe it's something to do with my configuration:

 

Zend Server CE running locally

Zend Studio 7.0.2

PHP 5.2.6

Zend Framework 1.9.0 (r17310)

 

Is there another alternative, such as applying a decorator to this object?  If so, which decorator would allow me to change the styling on this particular object?

On Fri, Nov 13, 2009 at 10:07 AM, Rob Keplin <[hidden email]> wrote:

I have something like this, which works:

$this->addElement(
            'ValidationTextBox',
            'zip_code',
            array(
                'label'        => 'Zip Code',
                'trim'        => true,
                'maxLength' => 5,
                'required'    => true,
                'regExp'    => '^[0-9]{5,5}$',
                'invalidMessage' => 'Valid Zip Code Required. Ex: 90210'
            )
        );




Andrew Sledge wrote:

Alas, still no.  At this point I think I've tried just about every combination possible.

On Fri, Nov 13, 2009 at 9:27 AM, Wouter de Gooijer <[hidden email]> wrote:

Try this:

$this->addElement('ValidationTextBox', 'name', array(

        'label'      => 'Name:',

                   

'attribs'     => array(

                'size' => 8,
                'maxLength' => 8,
           ),


        'required'   => true,

        'filters'    => array('StringTrim'),

        'regExp' => $regex,

        'validators' => array(

            array('Regex',false,array('/^'.$regex.'$/'))


        ),

 

On Fri, Nov 13, 2009 at 15:06, Andrew Sledge <[hidden email]> wrote:

Unfortunately, this doesn't work.  I've tried applying options size, max, maximum, and maxlength with no desirable outcome.

 

On Fri, Nov 13, 2009 at 6:23 AM, J DeBord <[hidden email]> wrote:

 

On Fri, Nov 13, 2009 at 4:33 AM, Andrew Sledge <[hidden email]> wrote:

Hello all,

 

This is in relation to Zend_Form.  Apparently I'm missing the obvious, but how do you change the size attribute of a ValidationTextbox element?

 

$this->addElement('ValidationTextBox', 'name', array(

        'label'      => 'Name:',

        'size' => 8,



        'required'   => true,

        'filters'    => array('StringTrim'),

        'regExp' => $regex,

        'validators' => array(

            array('Regex',false,array('/^'.$regex.'$/'))

        ),

Here is my element

 

$this->addElement('ValidationTextBox', 'name', array(

'label'      => 'Name:',

'required'   => true,

'filters'    => array('StringTrim'),

'regExp' => $regex,            

'validators' => array(

array('Regex',false,array('/^'.$regex.'$/'))

),

'decorators' => array(

array('DijitElement', array('maxlength' => 1)),

'Errors',

array('HtmlTag', array('tag' => 'div')),

array('Label', array('tag' => 'div')),

array('Description', array('tag' => 'div')),

),

));

 

I want the input element to have the size attribute to have 8.  Any and all help is most appreciated.


--
Andrew Sledge

 

 

--
Andrew Sledge


Yours,

Wouter de Gooijer




--
Andrew Sledge




--
Andrew Sledge





--
Andrew Sledge

Reply | Threaded
Open this post in threaded view
|

Re: Changing the size attribute of a validationtextbox element

Andrew Sledge
Yes.  It seems that my instance is wrapping the input container in extra dojo "stuff".   I am just coming back to ZF after not using it since ~1.2.  A lot of things have changed...

On Fri, Nov 13, 2009 at 12:19 PM, J DeBord <[hidden email]> wrote:

On Fri, Nov 13, 2009 at 6:13 PM, Andrew Sledge <[hidden email]> wrote:
When I tried this, I get 

<input type="text" name="name" autocomplete="off" dojoattachpoint="textbox,focusNode" class="dijitReset" aria-invalid="true" id="weight" tabindex="0" aria-required="true" value="" required="true" dojotype="dijit.form.ValidationTextBox"/>

I don't know what the difference is.

You tried the code exactly as I wrote it? If so, hopefully someone smarter than us can figure it out. Good luck.
 
On Fri, Nov 13, 2009 at 11:57 AM, J DeBord <[hidden email]> wrote:
This:

<?php

class Form_Test extends Zend_Dojo_Form {

public function init()

{
$this->addElement('ValidationTextBox', 'name', array(
'label' => 'Name:',
'required' => true,
'size' => 8,
'filters' => array('StringTrim'),
'validators' => array(

),
'decorators' => array(
array('DijitElement', array('maxlength' => 1)),
'Errors',
array('HtmlTag', array('tag' => 'div')),
array('Label', array('tag' => 'div')),
array('Description', array('tag' => 'div')),
),

));
}
}

Outputs this:

<form><dl class="zend_form_dojo">
<div id="name-label"><label for="name" class="required">Name:</label></div>
<div>
<input size="8" id="name" name="name" value="" type="text"></div></dl></form>
I'm using 5.2.11 and ZF 1.9.5

Jason DEBORD
Zend Certified Engineer

http://www.jasondebord.net
http://www.nobrandapp.com



On Fri, Nov 13, 2009 at 5:23 PM, amtdev <[hidden email]> wrote:

Try this format:

 

// add element: zip textbox

      $zip = $this->createElement('text', 'zip_code');

      $zip->setLabel('Zip Code:');

      $zip->setRequired(true);

      $zip->setAttrib('size', 30);

      // Etc., etc.

      $this->addElement($zip); 

 


From: Andrew Sledge [mailto:[hidden email]]
Sent: Friday, November 13, 2009 10:50 AM
To: [hidden email]
Subject: Re: [fw-mvc] Changing the size attribute of a validationtextbox element

 

That still did not work.  Maybe it's something to do with my configuration:

 

Zend Server CE running locally

Zend Studio 7.0.2

PHP 5.2.6

Zend Framework 1.9.0 (r17310)

 

Is there another alternative, such as applying a decorator to this object?  If so, which decorator would allow me to change the styling on this particular object?

On Fri, Nov 13, 2009 at 10:07 AM, Rob Keplin <[hidden email]> wrote:

I have something like this, which works:

$this->addElement(
            'ValidationTextBox',
            'zip_code',
            array(
                'label'        => 'Zip Code',
                'trim'        => true,
                'maxLength' => 5,
                'required'    => true,
                'regExp'    => '^[0-9]{5,5}$',
                'invalidMessage' => 'Valid Zip Code Required. Ex: 90210'
            )
        );




Andrew Sledge wrote:

Alas, still no.  At this point I think I've tried just about every combination possible.

On Fri, Nov 13, 2009 at 9:27 AM, Wouter de Gooijer <[hidden email]> wrote:

Try this:

$this->addElement('ValidationTextBox', 'name', array(

        'label'      => 'Name:',

                   

'attribs'     => array(

                'size' => 8,
                'maxLength' => 8,
           ),


        'required'   => true,

        'filters'    => array('StringTrim'),

        'regExp' => $regex,

        'validators' => array(

            array('Regex',false,array('/^'.$regex.'$/'))


        ),

 

On Fri, Nov 13, 2009 at 15:06, Andrew Sledge <[hidden email]> wrote:

Unfortunately, this doesn't work.  I've tried applying options size, max, maximum, and maxlength with no desirable outcome.

 

On Fri, Nov 13, 2009 at 6:23 AM, J DeBord <[hidden email]> wrote:

 

On Fri, Nov 13, 2009 at 4:33 AM, Andrew Sledge <[hidden email]> wrote:

Hello all,

 

This is in relation to Zend_Form.  Apparently I'm missing the obvious, but how do you change the size attribute of a ValidationTextbox element?

 

$this->addElement('ValidationTextBox', 'name', array(

        'label'      => 'Name:',

        'size' => 8,



        'required'   => true,

        'filters'    => array('StringTrim'),

        'regExp' => $regex,

        'validators' => array(

            array('Regex',false,array('/^'.$regex.'$/'))

        ),

Here is my element

 

$this->addElement('ValidationTextBox', 'name', array(

'label'      => 'Name:',

'required'   => true,

'filters'    => array('StringTrim'),

'regExp' => $regex,            

'validators' => array(

array('Regex',false,array('/^'.$regex.'$/'))

),

'decorators' => array(

array('DijitElement', array('maxlength' => 1)),

'Errors',

array('HtmlTag', array('tag' => 'div')),

array('Label', array('tag' => 'div')),

array('Description', array('tag' => 'div')),

),

));

 

I want the input element to have the size attribute to have 8.  Any and all help is most appreciated.


--
Andrew Sledge

 

 

--
Andrew Sledge


Yours,

Wouter de Gooijer




--
Andrew Sledge




--
Andrew Sledge





--
Andrew Sledge




--
Andrew Sledge
Reply | Threaded
Open this post in threaded view
|

Re: Changing the size attribute of a validationtextbox element

Andrew Sledge
This seems to be less of a ZendFW issue and more of a Dojo/Dijit issue.  Others have encountered similar problems: http://mail.dojotoolkit.org/pipermail/dojo-interest/2009-June/036610.html.

It is fixed with applying a 'style' rather than a 'size' or a 'max' or a 'maxlength'.  The following accomplishes the same goal:

        $this->addElement('ValidationTextBox', 'name', array(
            'label'      => 'name:',
            'style' => "width: 5em",
            'required'   => true,
            'filters'    => array('StringTrim'),
            'regExp' => $regex,
    'validators' => array(
                array('Regex',false,array('/^'.$regex.'$/'))
            ),
    'decorators' => array(
                'DijitElement',
     'Errors',
                array('HtmlTag', array('tag' => 'div')),
                array('Label', array('tag' => 'div')),
                array('Description', array('tag' => 'div')),
            ),
        ));

Thank you for helping.

On Fri, Nov 13, 2009 at 12:35 PM, Andrew Sledge <[hidden email]> wrote:
Yes.  It seems that my instance is wrapping the input container in extra dojo "stuff".   I am just coming back to ZF after not using it since ~1.2.  A lot of things have changed...


On Fri, Nov 13, 2009 at 12:19 PM, J DeBord <[hidden email]> wrote:

On Fri, Nov 13, 2009 at 6:13 PM, Andrew Sledge <[hidden email]> wrote:
When I tried this, I get 

<input type="text" name="name" autocomplete="off" dojoattachpoint="textbox,focusNode" class="dijitReset" aria-invalid="true" id="weight" tabindex="0" aria-required="true" value="" required="true" dojotype="dijit.form.ValidationTextBox"/>

I don't know what the difference is.

You tried the code exactly as I wrote it? If so, hopefully someone smarter than us can figure it out. Good luck.
 
On Fri, Nov 13, 2009 at 11:57 AM, J DeBord <[hidden email]> wrote:
This:

<?php

class Form_Test extends Zend_Dojo_Form {

public function init()

{
$this->addElement('ValidationTextBox', 'name', array(
'label' => 'Name:',
'required' => true,
'size' => 8,
'filters' => array('StringTrim'),
'validators' => array(

),
'decorators' => array(
array('DijitElement', array('maxlength' => 1)),
'Errors',
array('HtmlTag', array('tag' => 'div')),
array('Label', array('tag' => 'div')),
array('Description', array('tag' => 'div')),
),

));
}
}

Outputs this:

<form><dl class="zend_form_dojo">
<div id="name-label"><label for="name" class="required">Name:</label></div>
<div>
<input size="8" id="name" name="name" value="" type="text"></div></dl></form>
I'm using 5.2.11 and ZF 1.9.5

Jason DEBORD
Zend Certified Engineer

http://www.jasondebord.net
http://www.nobrandapp.com



On Fri, Nov 13, 2009 at 5:23 PM, amtdev <[hidden email]> wrote:

Try this format:

 

// add element: zip textbox

      $zip = $this->createElement('text', 'zip_code');

      $zip->setLabel('Zip Code:');

      $zip->setRequired(true);

      $zip->setAttrib('size', 30);

      // Etc., etc.

      $this->addElement($zip); 

 


From: Andrew Sledge [mailto:[hidden email]]
Sent: Friday, November 13, 2009 10:50 AM
To: [hidden email]
Subject: Re: [fw-mvc] Changing the size attribute of a validationtextbox element

 

That still did not work.  Maybe it's something to do with my configuration:

 

Zend Server CE running locally

Zend Studio 7.0.2

PHP 5.2.6

Zend Framework 1.9.0 (r17310)

 

Is there another alternative, such as applying a decorator to this object?  If so, which decorator would allow me to change the styling on this particular object?

On Fri, Nov 13, 2009 at 10:07 AM, Rob Keplin <[hidden email]> wrote:

I have something like this, which works:

$this->addElement(
            'ValidationTextBox',
            'zip_code',
            array(
                'label'        => 'Zip Code',
                'trim'        => true,
                'maxLength' => 5,
                'required'    => true,
                'regExp'    => '^[0-9]{5,5}$',
                'invalidMessage' => 'Valid Zip Code Required. Ex: 90210'
            )
        );




Andrew Sledge wrote:

Alas, still no.  At this point I think I've tried just about every combination possible.

On Fri, Nov 13, 2009 at 9:27 AM, Wouter de Gooijer <[hidden email]> wrote:

Try this:

$this->addElement('ValidationTextBox', 'name', array(

        'label'      => 'Name:',

                   

'attribs'     => array(

                'size' => 8,
                'maxLength' => 8,
           ),


        'required'   => true,

        'filters'    => array('StringTrim'),

        'regExp' => $regex,

        'validators' => array(

            array('Regex',false,array('/^'.$regex.'$/'))


        ),

 

On Fri, Nov 13, 2009 at 15:06, Andrew Sledge <[hidden email]> wrote:

Unfortunately, this doesn't work.  I've tried applying options size, max, maximum, and maxlength with no desirable outcome.

 

On Fri, Nov 13, 2009 at 6:23 AM, J DeBord <[hidden email]> wrote:

 

On Fri, Nov 13, 2009 at 4:33 AM, Andrew Sledge <[hidden email]> wrote:

Hello all,

 

This is in relation to Zend_Form.  Apparently I'm missing the obvious, but how do you change the size attribute of a ValidationTextbox element?

 

$this->addElement('ValidationTextBox', 'name', array(

        'label'      => 'Name:',

        'size' => 8,



        'required'   => true,

        'filters'    => array('StringTrim'),

        'regExp' => $regex,

        'validators' => array(

            array('Regex',false,array('/^'.$regex.'$/'))

        ),

Here is my element

 

$this->addElement('ValidationTextBox', 'name', array(

'label'      => 'Name:',

'required'   => true,

'filters'    => array('StringTrim'),

'regExp' => $regex,            

'validators' => array(

array('Regex',false,array('/^'.$regex.'$/'))

),

'decorators' => array(

array('DijitElement', array('maxlength' => 1)),

'Errors',

array('HtmlTag', array('tag' => 'div')),

array('Label', array('tag' => 'div')),

array('Description', array('tag' => 'div')),

),

));

 

I want the input element to have the size attribute to have 8.  Any and all help is most appreciated.


--
Andrew Sledge

 

 

--
Andrew Sledge


Yours,

Wouter de Gooijer




--
Andrew Sledge




--
Andrew Sledge





--
Andrew Sledge




--
Andrew Sledge



--
Andrew Sledge