I have two roles i-e, Admin & User. Admin have access to add dynamic field in form and the form is saved in json format and now user can access that form and input data in it and its also saved in json format.
My problem is that when admin edit the form and add a new field inside it, how can i tackle this.
For example, admin make a form that have Product name, Product detail and Product pics and now user can add 5 items in it using this form, after few time admin added one more field in form, that is Product Type and how can i add this field in users previous posts.
Note: Admin form and user submission is in json format but both are saved in separate tables.
Admin Form Builder
Json of form builder and its save in form_sections table
User View of form
Users json is store in products table
when admin update form, json of form builder is updated but how i update the user json?
Changing the Product schema require your application to be backward compatible.
That means your code should be able to deal with both new data(with Product Type field) and old data(without Product Type field).
Possible solutions:
Leave old product Product Type field empty, let user fill it later.
Loop through old product data and set Product Type field with a default value.
Related
I created one form which has an email field for taking multiple user email ids with a comma ',' and I want to store that emails into my DB collection. I already fetch one email id at signup time and that I want to display as the default email and if user want to multiple emails then input be like- default#email.com,another#email.com
e.g when the add_alert.js file render then user email id which is already in the user collection that displays in the input field and if a user wants to add another email then he/she can enter via comma seperator and submit the form. and after submitting both email ids store in array in my db.
I used MongoDB, nodejs, express-js and semantic UI for my project.
aert.js - modal file:
var alertSchema = new mongo.Schema({
......
user:{
type:mongo.Schema.Types.ObjectId,
ref: 'User'
},
email:Arrays, // the email id which is for sending alert error
.....
})
add_alert.pug
p.lead.inline_block
span.muted.definition_header Enter your email:
.ui.input.inline_block.required
input(required='', value=alert.email type='email',disabled=req.params.email,name='email', style="width: auto")
I am not getting predefine value if I set value=user.emails in the input filed, then how it would be possible to store another email
I have a webform in ASP.NET this form includes almost 40 fields from which some are picture upload fields.
If some fields are not related to user he/she will not put any value in them so how can I handle this if some values are not insert by user in form. So that its doesn't through an error due to empty fields.
This isn't to do with program logic as much as it is business logic so you could do this:
When a user does not input any data into a field you could:
1) Allow your database table(s) to accept null values for when this case occurs and treat the data that you use in future as though it may contain nulls.
2) Populate any fields that the user did not enter any information in with 'dummy data'. This is to say that you could do something like:
string someForm = "";
if(string.isNullOrEmpty(txtSomeForm.Text))
{
someForm = "N/A";
}
Then you check within your program for whether the string that was input by the user, and saved to the database equals "N/A" (non-applicable). If it equals "N/A" then you know it's not relevant to the user.
i made multiple steps form that the user needs to fill all of them
1st Form (personal details)
2nd Form (education details)
and both action pointed to one servlet which is SaveServlet
can any one of you help me on how to make the second servlet saved in the database? so far i tried only the first form managed to be saved in the database..
i also tried using one servlet for one form and both form were saved into the database but i dont know how to pass the id from the first form into the second form hence im trying to do multiple form in one servlet so that the id would be the same
At the time of 1st Form submitted, do 3 things,
1) Persist data in DB.
2) Set attributes in session and redirect to same JSP.
3) Make a hidden input parameter in 2nd form with the value of ID from 1st form. data-attributes can also be used in this case.
Now you have ID from 1st form to be used when 2nd form is submitted.
I guess you can use ajax for handling multiple forms.
I am trying to set the value of a custom field that belongs to a contact via the Infusionsoft API.
When I try to create or update the contact with the custom field value set I receive the following response:
[NoFieldFound]No field found: Contact.InitialSiteVisitTime
Which leads me to believe that the custom field value is stored in a different table. Can anyone please tell me the name of the table that holds Infusionsofts custom field values?
Infusionsoft automatically prefixes custom field names with an underscore. Adding the underscore to the name allows to populate this value via the API successfully.
Note, that custom fields API names (the way they stored in Infusionsoft database) not always equal to how you name a custom field on creation.
This article shows where your actual custom fields API names are listed.
i have a custom post type
this post type needs some fields to be inserted into a custom MySQL table (wp_my_custom_table) where i store some relations IDs with other products and a number to sort them
i don't know how to put these input fields them after the textarea. I know how to insert them at "save_post" action hook.
these are not registered as "custom fields", are just a few input fields needed for each post type like this
The tag doesn't work, so i put the code that i have tried as image:
I have found, there is a hook "edit_form_after_editor".