How to in SimpleScheme get DOM data from Form in Meteor - forms

Hi Im trying to have a simple form in meteor where I have values that stay the same and one value that changes all the time with a random generator. However when I sent the data, the form in send empty data or just 'true'.
See Example
I'm trying to get the simple form to sent the random generated data
Example 1.1

Related

DocuSign API: Is it possible to filter envelopes by the value a document field?

Assuming I have a field with label FOO in all the envelopes sent, how do I filter the envelopes where the value of FOO is 123456?
I tried setting the search_text parameter with 123456 but it doesn't work.
This is the request I tried to use:
https://demo.docusign.net/restapi/v2.1/accounts/reste_idreste/envelopes?from_date=2021-02-01&search_text=123456
Unfortunately, there's not currently a way to search Tabs/Form Data via the API. We do have long term plans in this area, but nothing firm yet. I would pass this request along to your account team to let them know you are interested in learning more about that functionality as it develops.
The ListStatusChanges call doesn't allow you to pull form data in bulk. You'd need to make one GetEnvelope call per envelope with include=recipients,tabs to pull form data and parse through it yourself.
If this is something you are looking at building out, you could use populate a local database using the GetEnvelope results, and then use DocuSign Connect to automatically pass information about new envelopes moving forward.
It is possible to search for values of Envelope Custom Fields. Moving forward, if your application can populate an ECF, you can then search for that to find specific envelopes.

How do I trigger form validation without binding a request?

I have a very long order form that enables saving drafts. If saved as draft, only order name is required but when actually placing an order a more thorough validation is required. I implemented this by using different validation groups. When editing the order I display two buttons: "Save draft" and "Place order". Each of them performs validation using a different validation group.
But now I would like to make a button on the list of orders which enables to change order status from 'draft' to 'placed' directly. To do so, validation must be performed without displaying edit form and submitting it. I would just like to validate the entity that is already in the database. I can use the validator service and everything is simple as long as the data is valid. But in case data isn't valid, I would like to redirect user to the edit form with fields with missing data highlighted. The idea seems to load data from database into the form and run validation as if that data were sent using a browser but execution of this doesn't seem to be trivial because Symfony2 triggers validation on form only when binding the request.
I was going through the Symfony source code and found s class called Symfony\Component\Form\Extension\Validator\EventListener\ValidationListener. It seems to attach itself on the FormEvents::POST_SUBMIT event. Is there a way to trigger this event manually from the controller without request binding? Or are there any alternative approaches to my problem?
Just to point out the correct answer already given by Matjaž Drolc in the comments:
If you want to validate a form without getting the data from the request, you have to call the form->submit() function, because Symfony does not validate the fields if they are not marked as submitted, which is done by this function.
Call the function like this
$form->submit(array(), false);
With an empty array as the submitted data and not clearing the missing fields.

Multi step form validation Codeigniter

Is it possible in Codeigniter to run a multi-step Form validation, such that, when an error has been found, the form validation will stop (not validating the other Form validation rules)?
With the set_rules() and run() method of the Form_validation class, all the rules are checked even if it does not pass the first one.
Or is it better to validate those criteria in my model in the particular order (such that it stops on a validation error) and pass the single error message to my view?
Ralph, I am not sure you can do it with standard CI validation library.. You may need to extend/overwrite it in order to achieve what you want. You can display a first error message individually, but in the background the full data check would run.
Depending on how complex the data validation you need, you could also get some jQuery plugin to roughly check the data before the form is submitted. This will reduce the risk of bad data being sent and may reduce the overhead on server side.

TextField Autocompletion with JSON Response

What I want :
I want to use Auto Completion of Text field in my App.As my data is coming from the web service, I want to perform the "Auto Completion" with the JSON Response.
What I Know :
I know that first I have to fetch data from the web service. Then I need to parse it and fill the Array with that parsed data and then I can use that array to perform Auto Completion.
Problem :
I don't know how to send the requests to get JSON data for each "prefix" that user types in text field (means I want JSON Data during Typing). I know how to perform "JSON Parsing" and "Auto completion of text fields" independently but no idea regarding "TextField Autocompletion with JSON Response". I tried a lot to find the answer regarding this but i failed. So Please Help me...
I am using the doautocompletetextfield to perform "Text field Auto completion".
Better Suggestion for this problem will be appreciated.
Any Solutions ?
You can use linear searching just like done in the api example or can use NSPredicate for fast searching in your autoCompleteArray.
According to your problem, you will get json data first, then you need to save relevant data from json into some array and then you can use this api to autocomplete the text in text field.
But i am confused about your this statement: "I don't know how to send the requests to get JSON data for each "prefix" that user types in text field."
1) Do you want to get json data from web service during typing?
2) Or you want to fetch data from json dictionary during typing?
If you want to go with option (1), i think it would be bad way to solve the problem.
And if you want to go with option (2) then you need to parse json and extract data of your interest and save it in an array. And then do autocomplete on the basis of the contents of that array.

How can I best deal with problems when initializing a model in an iphone app?

So assume I have a class that has an init method that does something like... grabs some data off the net in xml format and parses it to initialize some of its properties. My concern is how should I handle the case where the network is down or the xml data my object receives is bad?
Normally in C i would use return values to indicate an error and what kind and then that would get propagated back till I could report it to the user. I don't really think that will work in this situation.
Use asynchronous network requests.
Create the UI and show it with
either dummy replacement for the
actual values (like pictures) or no
data (for example empty table).
Then create and send the request for
data and register handler that gets
called with data.
When you receive data your handler
gets called with them.
You parse the data and update the
UI. In case of data being invalid
you can now update UI to inform the
user.
You can use timeouts to cancel
requests in case of network problem
and functions not returning with
data within specific time.
There was an example in last year Stanford's CS193p class (iPhone programming but the same applies to desktop apps) with showing empty user interface and updating it when data coming back. You can probably find references to it on net or otherwise there'll be new example this year.
For network down you have a few options
Alert the user you cannot retrieve the needed data
Show stale (last loaded, maybe not stale?) data
For Bad Data:
Alert the user
Try again
Show old data
Try to fix the data (missing a closing tag? etc)
Show a subset of the data (maybe you can extract something that is usable?)
As far as error codes, you can do:
Return codes ie bad_data -1, no_network -2, etc.
You can throw exceptions, catch them and map them to user friendly display messages