Remove duplicate entries from validation summary asp.net - asp.net

I have a validation summary control on my page and my required field validators are in a list view. The listview can have any number of items, therefore I will have multiple validators with the same message. For example my list view could have 5 textboxes asking for a name, each textbox has a required field validator attached to it with the message "Please fill in your name". In my validation summary it shows 5 error messages all saying "Please fill in your name". How can I make it so that the validation summary shows one error with something like "Names are required".
Any help is much appreciated.
Thanks

Look into using a Custom Validator. You can set the error message to "Names are required", and then in the custom validation check the status of each of your name fields. You can also wire up a Client side script with ClientValidationFunction as well.

Related

Conditionally loading multiple fields with multiselect with Caldera Forms for Wordpress

Good day,
I've been looking around for a solution to my problem, but could not find it documented anywhere. Feel free to link to another thread if useful.
I'm building a form on Wordpress using Caldera Forms. In this form, I have a multiselect dropdown for which each selection should show dynamically an extra field. Unfortunately, I cannot load more than one conditional field when selecting multiple values. It will only load the first field populated by the condition of my first selection.
Try it out:
Open https://34.95.27.135/test-caldera/
On the "Role" field, select "Software Engineer"
This should populate a "Top Skills" field
On the "Top Skills" field, if you autocomplete ANY of the options, the first condition is met and you will see the right field for it
Selecting more options from the "Top Skills" field should be populating other fields, but instead, it flicks in the view and then only shows the first met conditional field.
Anyone has had this issue? Was there anything special to do on the Conditions tab to make it work as intended?
You may Import this form by importing this JSON:
{"_last_updated":"Sun, 19 Jan 2020 23:23:23 +0000","ID":"CF5e213a11b5adc","cf_version":"1.8.9","name":"Career Matrix","scroll_top":0,"success":"Form has been successfully submitted. Thank you.\t\t\t\t\t\t\t\t\t\t\t\t","db_support":1,"pinned":0,"hide_form":1,"check_honey":1,"avatar_field":"","form_ajax":1,"custom_callback":"","layout_grid":{"fields":{"fld_97450":"1:1","fld_5750655":"1:1","fld_4465116":"1:1","fld_2852708":"1:1"},"structure":"12"},"fields":{"fld_97450":{"ID":"fld_97450","type":"filtered_select2","label":"Top Skills","slug":"your_top_skills_software_engineer","conditions":{"type":"con_9081220263929126"},"required":1,"caption":"Select your top skills.","config":{"custom_class":"","placeholder":"","multi":1,"color":"#5b9dd9","border":"#4b8dc9","default_option":"","auto_type":"","taxonomy":"category","post_type":"post","value_field":"name","orderby_tax":"name","orderby_post":"name","order":"ASC","default":"","show_values":1,"option":{"opt2039319":{"calc_value":"x","value":"x","label":"x"},"opt2036344":{"calc_value":"y","value":"y","label":"y"},"opt2092176":{"calc_value":"z","value":"z","label":"z"}},"email_identifier":0,"personally_identifying":0}},"fld_4465116":{"ID":"fld_4465116","type":"star_rating","label":"z Proficiency","slug":"z_proficiency","conditions":{"type":"con_4202235771498248"},"caption":"Rate your z proficiency","config":{"custom_class":"","default":"","number":5,"type":"star","size":13,"space":3,"color":"#FFAA00","track_color":"#AFAFAF","email_identifier":0,"personally_identifying":0}},"fld_2852708":{"ID":"fld_2852708","type":"star_rating","label":"y Proficiency","slug":"y_proficiency","conditions":{"type":"con_6383484066940033"},"caption":"Rate your y proficiency","config":{"custom_class":"","default":"","number":5,"type":"star","size":13,"space":3,"color":"#FFAA00","track_color":"#AFAFAF","email_identifier":0,"personally_identifying":0}},"fld_5750655":{"ID":"fld_5750655","type":"star_rating","label":"x Proficiency","slug":"x_proficiency","conditions":{"type":"con_5108268722503233"},"caption":"Rate your x proficiency","config":{"custom_class":"","default":"","number":5,"type":"star","size":13,"space":3,"color":"#FFAA00","track_color":"#AFAFAF","email_identifier":0,"personally_identifying":0}}},"page_names":["Page 1"],"mailer":{"on_insert":1,"sender_name":"Caldera Forms Notification","sender_email":"dube25#gmail.com","reply_to":"","email_type":"html","recipients":"","bcc_to":"","email_subject":"Career Matrix","email_message":"{summary}"},"conditional_groups":{"conditions":{"con_5108268722503233":{"id":"con_5108268722503233","name":"SE x Skill","type":"show","fields":{"cl6611176254177354":"fld_97450"},"group":{"rw1073423041345211":{"cl6611176254177354":{"parent":"rw1073423041345211","field":"fld_97450","compare":"is","value":"opt2039319"}}}},"con_6383484066940033":{"id":"con_6383484066940033","name":"SE y Skill","type":"show","fields":{"cl4932869345780543":"fld_97450"},"group":{"rw2445485636298987":{"cl4932869345780543":{"parent":"rw2445485636298987","field":"fld_97450","compare":"is","value":"opt2036344"}}}},"con_4202235771498248":{"id":"con_4202235771498248","name":"SE z Skill","type":"show","group":{"rw3854064841859657":{"cl7317560418250427":{"parent":"rw3854064841859657","field":"fld_97450","compare":"is","value":"opt2092176"}}},"fields":{"cl7317560418250427":"fld_97450"}}}},"settings":{"responsive":{"break_point":"sm"}},"privacy_exporter_enabled":false,"version":"1.8.9","db_id":"19","type":"primary"}
Thank you very much!

Submitting "complex" ASP.net forms using cURL&PHP

I'm trying to create a bot to submit a ASP.net form using cURL and PHP. I'm able to do this with simple forms but I got stuck with one email form that uses a grid. Looking the network traffic when submitting the form I found this as one of the parameters posted to the form:
panForm$cbpEmail$FormLayout$grdFaleConoscoDestinatarios: {"selection":"T","callbackState":"z952aVWEs2XJ9DNtuoB8EI0qtZom3Guwv37Ny34ch6u8rMA6ASD0MLgS8vw+0Bz88+PlMhyGnAlnYDZXOy6C0OCBknNqTSUClocyeoOOYcO6KfoLUvLMZWRTBGRY+WUBG3MKabwqmYopS8A42gKWxUHlS7fr98CEILuzK6NAfyuUbgSD878Xtus2kFakVyx9PCQZTvqmUxRS2yiriUhy2C5SkeEjl7htRbAXdgcHr/PM+TRP3QacVdGk52pEBS0IdkY95M7tI8iW55GuMkvhq3exptJZDfibhBx7dvNuZXKX3ro7tVT2FxZVlgrjqwUBi0mGgbMXHbscXTRRJ71LKXf3GSstqEGffjAoZPyJh8LufZ1I4rvSFTuL/CX4ktLel3JYHAolcf4GGgYGbJcou2g9IWIgRJ5OSfQLJyyah8hu1m+zx5QHl6GfDtrbEJVG42agGae97pDLzIAucmEMcySA03aQb1BAE0hUU4qqfXMRlBBnw6WspsGHXsv54xCI2RXP0OlX8cNmfZ0tAgIFO6RLlxRSEhm3ogvaCTVCEgMbfT6bxgrFaF6pLg10GqF9FLCI2r05u/0SzLNTzczXUe444FE4gGf+MZaPgD62AQaxVXt/5QlEKl8kXgKEbNZ8ew8eFT+ldOOy7tiS4aIwmrawrpVisCkJS0FupIG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ahZ0tECcDLAtpjjVbdYLJtL64Z6kHZKSjZwduHtTNzG4XtE9d5NCZITbQ8L2Qtr1jm1ZDYPd2p92yHZgwaNmmtieSsOaxeDNE/l4cVs3kRo5BOXG1V7snk/IOoecMdQ3gJ7UhOMfnD0u4QBRXSrje72ET7jb+RTI=","groupLevelState":{},"keys":["201259","201260","201261","201262","201263","201264","201265","201266","201267","201268","201269","201270","201271","201272","201273","201274","201275","201276"]}
This data represents a grid that is part of the email form where user is able to select who will receive the email.
My question is how can I mimic what ASP.net do to create this data from the grid that is on the page to be able to submit the email form? Does anyone have information about this "callbackstate"?
After submitting a lot of times the same form I realized that I don't need to care about the callbackState. What is important in my case is properly set the selection attribute of this JSON (provided during the creation of the component on the page).
The selection attribute represents the state of the checkboxes in the grid. T means true and F false. selection="T" means only first row selected while selection="FTFT" represents 2nd and 4th rows selected. Remaining rows not represented in the selection attribute are false by default.
Best Regards

Mandatory validation message, the field property is set to not mandatory

I have checked the Maproperties of the field & the data source of the form where this is used and the property is set to 'No'.
Though every time i am filling out the form get the following error:
What is the source of the validation error?
If the field is not set to mandatory on the AOT table or the form DataSource, check the validateWrite() and validateField() on the table and the DataSource.
Fields can also be made mandatory at run-time in code with this style:
salesTable_ds.object(fieldNum(SalesTable, SalesId)).mandatory(true);
So you'll have to debug!

ASP gridview: adding two values and validate

I use GridView to show/edit data in the database. In the GridView there are two columns called mark1 and mark2. What I want to do is when user clicks update, the program should check if the values entered at mark1 and mark2 sum to 100. If they don't the program should cancel the update and show an error message. How do I do it? I use ASP.NET with VB.
take a look at custom validation control. if you provide some code, i can fix it for you if it doesn't work.

Avoid same messages in ValidationSummary

I've a form with several RequiredFieldValidators.
For now, when a required field isnt completed there s an "*" next to the textbox and then the message in the ValidationSummary. But when there's, for instance, 3 required field uncompleted my ValidationSummary looks like this:
required
required
required
How can I have only one -required?
You can't. Best solution for this is to set the input name (Name, Website, etc) for the error message property. Then the user can intuitively determine which field they need to fill in.

Resources