Data validation techniques - Interactive, Preflight Checklist, etc - validation

I am working on a form filling program and I'm looking for suggestions on implementing data validation.
I'm considering a two-phase approach:
Interactive - after user enters data and attempts to move to the next field, flag invalid data with something non-obtrusive, like a balloon message but let the user continue on.
Preflight Checklist - Once the form is filled and the user attempts to print/send it, re-validate the form, notify user of errors and refuse to continue until corrections are made.
Any other ideas, suggestions?

I would always recommend validating at the server as well.
Otherwise, what you describe is what I typically see. Oh... and don't flag a required field as invalid if a user tabs through it, unless it's still blank when they submit, but if they enter "wrong" data into a field, indicate it immediately, as you describe.

OK, if you are asking about user experiace, then i would apply both 1 and 2.
As users input fields, highlight fields, that are required, incorrect with colours/icons (no blloons, they are in the way). Icons can then be clicked for explanation of why it is incorrect.
Also validate the form at the end, before submit, and highlight the incorrect fields/required missing fiels, but try to avoid step by step acceptance (click ok, and message per field missing, incorrect).
You could rather then have a display that tells the user the messages, but dont remove this, otherwise you are back where you started from, click and go.

Related

How to find where an Alert is initiated in Oracle Forms 6i?

in a Oracle 6i form, I have an alert defined, and a database block. Because it's a database block, when some data is entered, but not saved, when you try to exit this form, this alert pops up (asking 'Do you want to save this data?'). However, all this happens BY DEFAULT, I don't see any triggers/program units where this alert is called... Also, the text for this alert is also assigned dynamically, and I can't find any triggers/programs where it is being done... What am I missing? Thank you.
I'm not sure you can find it anywhere in Forms Builder; that behavior is built-in, Oracle Forms raises the alert when it finds out that one (or more) database items have been changed, and those changes not saved at the moment you're trying to e.g. exit the form, enter query mode, navigate to another record etc.
In order to prevent changes to be lost (end users would hate it, spending minutes to enter data which is gone without notice), Forms informs you about it and lets you choose whether you want to keep (save) those changes or not.
Therefore, just say "Thank you" every time you see it because those nice people at Oracle did it so that us, developers, wouldn't have to in each and every form we create.

Submit slack modal with block elements

On my modal view I have two datePicker elements. I know that payload with action information is sent after each interaction, but is it possible to pass all selected values after form submission?
I only came up with solution where after each interaction selected value is cached on the server side and bound to view_id.
Hi you can achieve this by placing your interaction component inside input block type. Slack documentation says.
Any interactive components used within input blocks will not send this block_actions payload. They are included in view_submission payloads only.
https://api.slack.com/reference/interaction-payloads/block-actions
An example I have created in block kit
If you do not need to receive the block_actions events, then use input blocks like GJoshi suggests.
But if you do need the block_actions events, then you cannot use input blocks (per https://api.slack.com/surfaces/modals/using#interactions). In that case, you can add the value to the private_metadata field via the views.update call. When the user clicks the submit button, the view_submission event payload will contain the private_metadata field.
For folks who stumble upon this as I did, the answers above are no longer up to date since now slack allows input blocks to dispatch block actions. The approach of using private_metadata is still relevant in some scenarios, but just receiving block actions makes life much easier.
Simply set "dispatch_action" to true when defining a specific input block to receive a payload whenever it gets updated.
Once the user submits, you will still have access to all the values of the input data

Pre-fetching logic in Rx

I'm trying implement my own pre-fetching logic in rx.js. Here is example marble diagrams:
I've modeled the problem as follows: There is a stream of hints that lets my program know that a user might want to click a certain link. I want to immediately send a request, but only render the result if the user indeed clicks the link.
Based on this, there are (at least) 3 things that can happen by the time the user clicks the link:
The correct result already returned form the server.
The request is still in progress
(Special) There is no request -- finished or in progress -- because the user somehow didn't trigger a hint first.
Some extra requirements:
Only the latest hint should have a request in progress (i.e. cancel previous requests).
Once the user clicks on a link, new hints should not trigger a request until the result is rendered
New clicks should trigger new requests and cancel the previous request
I've actually found a solution, but it is convoluted, maybe incorrect, and mostly I'd just like to know if there is a better way of doing it (see below).
EDIT: Now implemented in hy-push-state.

How to create a two-step MailChimp signup form?

How does one go about using the MailChimp API to create a two-step signup process? I'm having a really hard time finding any documentation for this. It should go like this:
Step 1:
The website shows a sign up form with just an email field and a subscribe button. Once someone fills out her/his email address and hits 'Subscribe', the email address gets added to the list, and then additional options show up in a modal window (name, location, interests, etc.)
Step 2:
At this stage the user has already been added to the mailing list. The user can now choose to fill in the additional fields in the modal window (which will then be added to her/his account), or if he doesn't, then certain default values are added, after which a thank you message is shown.
Any help would be greatly appreciated! Thank you.
I would suggest that you use a single signup form as you capture your subscribers ... users rarely want to do something in two steps. Make it easy for them to take all the actions they want in one screen.
When you design your form, consider what information is mandatory and what is optional. You will need to think of how you will use the fields, groups, etc later in campaigns.
You can provide default values for many of the fields. You can also specify what message to send for an initial subscription.
Remember, a user is not "subscribed" until they accept the "did you really mean to subscribe" email that is automatically send by MailChimp.

Using forms authentication, is it possible to switch the logged in user in code, just for the current request?

In a certain situation, I want a request to execute as a user different than the one actually logged in. So, when User A requests a particular page, from code I want to switch it execute under the user account of User B -- only for this single request (or even for a single block of code...)
I've used this:
FormsAuthentication.SetAuthCookie("UserB")
This works, but it's persistent. When I request a new page, I'm now logged in as User B, which is not what I want.
Is this possible? I've RTFM'd up and down for this.
Edit: I may have found an answer, which I posted below. Looking for confirmation or refutation of this solution.
I think I might have found it. I'm not 100% sure, but this works. I just don't know if it's completely correct or if there's something I'm not considering.
HttpContext.Current.User = PrincipalInfo.CreatePrincipal("UserB");
Again, this seems to do what I originally wanted. If you have experience that would prove me right or wrong, please comment.

Resources