Meteor autoform Form hidden fields not rendering defaultValue and not saving -
i have 2 hidden fields in autoform schema defined shown below. wish save 2 fields other fields while not showing them app user. noticed autoform rendered html 2 hidden fields have no value, don't save other fields db. not sure might missing / wrong here? help
invoice = new simpleschema({ clientid: { type: string, optional: true }, total: { type: string, label: 'total amount', optional: true }, tax: { type: string, label: 'taxes', optional: true }, category: { type: string, optional: true, autoform: { type: "hidden", label: false }, defaultvalue: 'test category' } }); {{> quickform id="invoiceform" buttoncontent="insert" buttonclasses="btn btn-primary btn-sm" schema=invoice type="method" meteormethod="saveinvoice"}}
i don't think can have field in aldeed schema render/ saved in form hidden field. suggest pass data (which wanted pass a hidden field) though sessions.
for example, if using autoform >> meteormethod save form, can save session content within server method. if not using method, might want pass hidden data through autoform.hooks >> onsubmit
Comments
Post a Comment