ddeveloper supports this item


289 comments found.

I am trying to add email format validation like on your cool example http://pdocrud.com/demo/moreforms/sign_up/sign_up.php

The ViewCode refers to formdoid but I don’t understand where this is and I read that it is not necessary

How do I get this email validation using pdocrud ?


If your field name contains the word email then it automatically applies the email validation else you can change the field type to email.


Wow, that’s cool thank you !

I notice the the validation is on Save. Which is fine

In your example http://pdocrud.com/demo/moreforms/sign_up/sign_up.php, it is as data is entered. Does some setting need to be enabled to produce that? Or some javascript added ?

i also noticed it is not complete validation – aa@aa without a TLD is saved into the form. Am I able to modify the validation to enforce this ? Where is your automatic validation stored ?

The more I work with your script, the more powerful it proves to be. Congratulations and thank you.


plugin has 2 option, whether to use script validation or use some other standard jquery plugin validations. currently we are using the bootstrap plugin validator



Fieldgroups – display formatting issue

I am using fieldgroups to lay out a form which is called as pop-up

mostly it works, but one group extends beyond normal width to edge of dialog I can’t see reason why Example here : https://ibb.co/dGHXSa


Any ideas on how to resolve ?

Grrrr, seems like I am an idiot Minor mistype on field name – should have been “spent-vat” All working now Hopefully this helps someone else

Hi – can you tell me, if I use standalone “EDITFORM” can the ID be a varchar, or does it need to be an int?

For example – this works: $pdocrud->setPK("id"); echo $pdocrud->dbTable("combined")->render("EDITFORM",array("id" => "1234"));

but this doesn’t:

$pdocrud->setPK("code"); echo $pdocrud->dbTable("combined")->render("EDITFORM",array("code" => "ABCDEF"));

Note – “code” is not the PK of the table, but it is unique. So I don’t know if it doesn’t work because “code” is a varchar or if it’s because “code” is not the pk of the table?

Many thanks


You need to set the primary key first with the correct column name and value of primary key needs to be passed in render function like below

$pdocrud->setPK(“code”); echo $pdocrud->dbTable(“orders”)->render(“EDITFORM”,array(“id” =>”58”));

I hope this clears your doubt.


AH! Perfect – thank you! I’d been struggling with that all day! Thank you for your prompt reply and help!

2 bugs in PopUp mode. Video from your demo site.

1 bug: https://www.sendspace.com/file/ywpebv 2 bug: https://www.sendspace.com/file/1c3pa8

Ok, I will check.


Repeatedly here, users asked about the error that occurs when saving empty fields in the database (for example, empty dates). I propose to all this temporary solution:

$pdocrud->datatable = 'Table Name'; $pdocrud->addCallback('before_insert', 'dataProcessing'); $pdocrud->addCallback('before_update', 'dataProcessing'); function dataProcessing($data, $pdocrud) { if (!empty($this->datatable) and !empty($data)) foreach($data[$this->datatable] as $key=>&$value) if ($value=='' or $value==NULL) $value = NULL; // Empty return $data; }


Yes, I have suggested to use same callback function but in version 2.4 I am adding some solution for that also.


For iakers (“EDITFORM”). Try it: $pdocrud->formSetPrimarykey('code', 'ABCDEF'); echo $pdocrud->dbTable('combined')->render('EDITFORM');

... Forum …

Yes, this can be done using this option also. I have suggested correct solution to iakers also


For css87 – thank you for your suggestion!! Also – thank you for your suggestion re callback for empty dates!! Very useful!

Hi – I think I may have found a bug – or at least some undesirable behaviour… could I lodge it for fixing please?

If I use $pdocrud->fieldDataAttr("manufacturer", array("disabled"=>"disabled")); to disable a field, but then want to use that field it in a CallBack, I get a Notice: Undefined index: manufacturer error. It’s the same for any field that I disable.

The code in the call back is referenced as $data["combined"]["manufacturer"]

If I enable the ‘manufacturer’ field, then the CallBack works correctly.

The problem I have is that I don’t want that field to be editable, but I do need it in the callback as it forms part of a SQL Where clause.

Am I doing something wrong, or do you think this is something you could fix in the next version please?

Many thanks

am using a diffrent graph plugin and i want it to read data from the database with pdocrud…here is the code (question is commented on the code)

<?php //pdo crud code $pdocrud = new PDOCrud(); //Pass value as sql query //procrud example //$pdocrud->addChart(“chart3”, “easypie”, “select count(*) as val from employee where `City`!=’’”, ””, ””, “sql”, array(“animate” => “100”)); //echo $pdocrud->render(“chart”, array(“chart3”));

// my chart plugin code example  bar graph 
$dataPoints = array(
     array("y" => 10, "label" => "peach"),
     array("y" => 4, "label" => "Mango"),
     array("y" => 5, "label" => "Orange"),
     array("y" => 7, "label" => "Banana"),
     array("y" => 40, "label" => "Pineapple"),
     array("y" => 6, "label" => "Pears"),
     array("y" => 7, "label" => "Grapes"),
     array("y" => 5, "label" => "Lychee"),
     array("y" => 4, "label" => "Jackfruit")
// i want to use this chart on my project. my question is, how can i pass my variables from database to this chart using pdocrud?