0

Is there a way that I can put a green tick or a red cross, and a process bar"Circular" besides a label in my forms? Basically I need to show if user has inputted text or not and if he/she is still inputting text, should I use ajax with zend? if so please give tips I am using Zend. Something like this image at the end of the link

How to put green tick or red cross in winforms?

Thanks.

Community
  • 1
  • 1
Programmer man
  • 393
  • 3
  • 14

1 Answers1

0

Zend is handling your server side logic and performs all the HTML generation, filtration, validation, etc. If you want Zend to generate additional code for your elements you will have to create a new form element decorator or layout your form manually using template (display each element separately instead of just <?= $form ?>. You can also look into ZendX project.

I suggest you take a little different route and add client layer for presentation. For example, when you define the element add certain classes to it...

$elem = new Zend_Form_Element_Text('my_element', array(
    'class' => 'required validate-phone ui-icon-phone'
));

On client side add some CSS

input[type=text].ui-icon-phone {
  background: url(...);
}

On client side add JS to bind to the classes of elements to do validation. I'd suggest to use jquery validation plugin... you can overload the way messages are displayed and user red X on invalid inputs. Also, look into Masked Input Plugin (see demo).

With such approach your service side code is independent of the client side code.

Alex
  • 6,441
  • 2
  • 25
  • 26