Forum

July 12th, 2025
A A A
Avatar

Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

The forums are currently locked and only available for read only access
sp_Feed Topic RSS sp_TopicIcon
Edit Form Allow Empty Date Field
17/04/2012
21:36
Avatar
scrombie
New Member
Members
Forum Posts: 1
Member Since:
17/04/2012
sp_UserOfflineSmall Offline

I have an add/edit form that needs to accept blank entries for a date field.  When the entry is submitted blank, I get the following error...

PHP Notice: Undefined offset: 0 in C:\Inetpub\wwwroot\Resources\jqGrid42\php\jqGrid.php on line 4093 PHP Notice: Undefined offset: 0 in C:\Inetpub\wwwroot\Resources\jqGrid42\php\jqGrid.php on line 4093 PHP Notice: Undefined offset: 0 in C:\Inetpub\wwwroot\Resources\jqGrid42\php\jqGrid.php on line 4093

If I enter 'null' in the field, it responds as desired (entering a NULL in the database field); however, I cannot expect my users to enter 'null' for this field.

The following is the configuration for the field and form...

$grid->setColProperty('PaidDate',array(
    "align"=>"center",
    "width"=>60,
    "label"=>"Paid Date",
    "formatter"=>"date",
    "formatoptions"=>array("srcformat"=>"Y-m-d H:i:s","newformat"=>"m/d/Y"),
    "editable"=>true,
    "editoptions"=>array("dataInit"=>"js:".$mydatepicker),
    "searchoptions"=>array("dataInit"=>"js:".$mydatepicker),
    "formoptions"=>array("elmsuffix"=>"  (mm/dd/yyyy)")    
));

$grid->setNavOptions('edit', array("height"=>"auto","width"=>"auto","dataheight"=>"auto","closeAfterEdit"=>true,"editCaption"=>"Edit Cash NSF Sale"));
$grid->setNavOptions('add', array("height"=>"auto","width"=>"auto","dataheight"=>"auto","closeAfterAdd"=>true,"addCaption"=>"Add Cash NSF Sale"));

I'm using php and SQL Server.

How can I get NULL entered in the database for a date field with no input?

Steven

18/04/2012
12:24
Avatar
tony
Sofia, Bulgaria
Moderator
Members

Moderators
Forum Posts: 7721
Member Since:
30/10/2007
sp_UserOfflineSmall Offline

Hello,

Please post he problem in the rigth forum

http://www.trirand.net/forum/

Thank you

Regards

For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.

Forum Timezone: Europe/Sofia

Most Users Ever Online: 994

Currently Online:
9 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

OlegK: 1255

markw65: 179

kobruleht: 144

phicarre: 132

YamilBracho: 124

Renso: 118

Member Stats:

Guest Posters: 447

Members: 11373

Moderators: 2

Admins: 1

Forum Stats:

Groups: 1

Forums: 8

Topics: 10592

Posts: 31289

Newest Members:

, razia, Prankie, psky, praveen neelam, greg.valainis@pa-tech.com

Moderators: tony: 7721, Rumen[Trirand]: 81

Administrators: admin: 66

Comments are closed.
Privacy Policy   Terms and Conditions   Contact Information