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

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+ldOOy7tiS4aIwmrawrpVisCkJS0FupIGqrFYQ8iRz4GvVgD9eH/lXG0s2aeGLTwcK8MEZ3qp5xKgyY60lC/u887OW4drHpV5m/Bie4qnr6Pip0Yyqw33ytWlwozggXAtmBuI9Je8SwDbWwtuPgzNvDwsaoprhxEHLb203lg3oKD+D419BJnBk9/xiRfrEJ5SEvantl/to/k+cTU6V6LGpU4YmfVejf/KMaXAjQpieawGMOm1dTNiZHYocEJZ9x4lcBRudGD57ZR7Zunn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te0NqbYXx+TFb6JRcgcjfwvghTiFVUvSyYMCkhsIHdkv2LkXU6PBSeDQyK5/r9cMKohiIylamspxHMJuQJUp1NH0oejtkrjaThSZzXyS5YnLW6MPF7pqsIKRWptaJYZlUqYQpLIJZnvu+/t6oboX+SUbMxLPH2kbiJVuaejyRsA430xcg376ht4IntJUBvZSsQyMhxIAu3jfjahgxP7TIvATgM3zG0gC5SVRVgyQAwdBZWz/H4wfz8xEFEoAA8EYj4Ijw3RepVBATvT9it7vsOtEoEuAnE5aJQ5YtTv+AoaRv5HqVGge2RZm5A0PeYJ00j+VVz/1WiP/w3Ys1EcqMVj5mrFqWTV0/1WqtOSBHw/cALQVRIjPZacF++Kh8v94EiL0Tb44DLwnPgMjcRDJxVifjK3u+VFjrCnvLaQdRRjTq3GVV3jaWQwdx4wRxUKdpfa9A6tH83qC28/tWYFkeUhRoTPOPmSwZJgsrD1+ShmN+b74257CGPAtvvpFk8VJSK//RuRyj7Mv1BfVAinzvPz4vLX4vAMg7p0DylKsTmmEb+WDYXzZegBxngS8wwvHUHErp+vm5De8H0GWW7cXWPGDmS8NNqex8sdPe02yFxH4UuDfUjNnWbTyNgH6pMQKuR/a9qTporlwD/4viOc5yyt0/rIs0+tRTL1kew3/uJ5Umcw1QHGc+e7ZTRFR+YnxiQUAKFRhBUvE/JNaAarH1z/qsg8WrDi6yHN/wOoZcGUgBm/2w8iULF5GKvV74xb2jDX5o9xb5c++GjpGDBbVL3Q96UHMAAjRa6u3r4aIbYt2eIQ6p8SjuUKRDNxwDidz7Bq0eO1ahZ0tECcDLAtpjjVbdYLJtL64Z6kHZKSjZwduHtTNzG4XtE9d5NCZITbQ8L2Qtr1jm1ZDYPd2p92yHZgwaNmmtieSsOaxeDNE/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

Related

Populate data based on the response given in Google Form

I have created two sections
First Section I have Order ID after entering the order ID and I click Next - In second section I want to populate order id's related data like (Name, Address, list of orders) All these data are available in an excel sheet, Once it is populated I would like the user to confirm their orders are correct and then hit submit.
Is this possible using google form or any add-ons for Google forms?
Thanks!
i read your question
As far i know about google form, google form don't give option to recheck your pre-filled options. So, what we can do is to give a confirm button at the end which is must required to fill.
You can see it through this example.
https://docs.google.com/forms/d/e/1FAIpQLSchhhCjcyQe-ZTdl8pFF-ETLPGFTXPcuqQGDGQ1nMbtcwOnGQ/viewform?usp=sf_link
If you want to create a more user defined form you can make it from simple html and php.
hope this will help you.
thanks!

How to print Activiti workflow task's values into Alfresco Share

I have a workflow to manage employee petitions, that starts with some fields at starter form. The next task, allows a responsable user to approve or reject the initiator user's petition.
I want to show the values of starting form into the approve/reject form, so I created a custom .ftl file for every field that I want print the label and the value. Now I have hard-coded the values to the this:
My problem here, is how to get the value from the first form and print it at the second form (values that I need are where says "200€" and my name).
I'm using Alfresco Community 5.1 and his own Activiti.
Thanks.
Solution 1 : keep IDs of the fields identical in both the forms. this will make the field editable in the second form.
Solution 2 : create a process variable, set its value after the first form has been submitted. then, in the second form display the value of the process variable.

Contact Form 7 - press button to validate fieldset

I've used Contact form 7 (wordpress plugin) to create a single form with multiple fieldsets.
The fieldsets are then split (using jquery) like this: http://thecodeplayer.com/walkthrough/jquery-multi-step-form-with-progress-bar
What I want to do is validate all the fields in the fieldset (without submitting the form) - is there a way to
1) validate fields using the validation in contact form 7 manually?
2) specify which fields to validate (based on only those in a fieldset)?
Ideally I want to be able to do it with flexibility in mind as I will be creating 2 or 3 other forms that perform the same way.
Edit: by validate I mean check that the field is:
a) filled in, if it's a required field
b) valid data (so making sure its an email address etc).
My problem is I want to validate the fields manually, without submitting the form, so I can stop them progressing on to the next step of form filling if they've not completed the current fieldset of fields correctly.
Carl
What you want to validate ?
If you want to validate an email address. You should write input type = email in your email textbox.
HTML will validate textbox itself, that it should be in email format.
Same as for digits. If you want to validate that a textbox should contain only number.
Use input type = number on your textbox.
Here is an Example:
https://jsfiddle.net/z9b5mcur/1/

How to create a form with variable no. of field set

I have to design a page for user information, for some background verification purpose, at my work. I need a set of fields for address, total count of which will be selected by user to update the form with that many fields. So, if user selects 3, form will have 3 set of address fields. Similar concept for work and education details.
Right now, I am passing the count to a handler page, which checks total count, and return it along with querystring, back to the main page. I am able to update the no. of fields, this way, but, all values are lost, once I return to the form. There are a lot of fields to even use session object for every value. Also, it resets the count of other such field set to 0. So, if I select 4 in address field, it renders four set of address fields, but fields for other details are gone.
I need to know, if it is possible to update the fields, using just one page, instead of creating a handler file to handle the redirect, so that I don't lose other data.
Sorry, for sounding a bit confusing. Will update the question, if needed.
Edit:
Similar blocks are there for education and work details. I want the update button to update the block, with that many fields, while retaining the values already entered by the user.
I have finally shifted the update code to one page. And the total count of blocks, is calculated by this way.
if request.form("addresscount") <> "" then
varaddresscount = request.form("addresscount")
else
varaddresscount = 1
end if
varaddresscount is used to loop through the html code which renders address fields. Even with this method, if I click on update button to change the total field count, every value entered by user is reset to default. Is there a way to retain the no. of fields without using session object, as there are way too many fields for which I have to store the value in session.
Why not have just a "add address" button that, whenever clicked, adds a extra set of input boxes using Javascript? That solves a lot of your problems regarding retaining the data on already filled in fields AND it makes it easier for the user.

user input forms with user defined fields

Ive been tasked with creating a user input form that has a set of defined fields and the ability for the user to add their own fields on the fly. e.g textbox, select box with options etc etc. Has anyone got any ideas on how i could implement this. What do i need to consider?
Also How would i store the data as i wont know the amount of fields. Generally in past projects a field in the input form has mapped to a column in the database.
Any ideas
Thanks in advance
It will need to be stored in a denormalised fashion:
QuestionField
AnswerField
So you'll probably need a Questions table which defines the question and maybe the type of input and any contraints.
You'll then have an answers table which is linked to whatever your entity is. The answers table will have an question and an answer field.
Do your users log into your site? If so you could use a SQL table to store each users controls e.g. :
UserName ControlID ControlType
JohnSmith 1 TextBox
JohnSmith 2 CheckBox
JoeBlogs 3 TextBox
You can then have another table with each controls value within it:
ControlID Value
1 My Text Value
2 False
3 Hi I’m Joe
You can then just do a simple join to get all the users controls and there values. You can also store information such as location/index of the control on screen. Doing it this way you can add more than one value per control, meaning things like list box's will have multipul rows.
If your not using a log in system you could do the same sort of thing but using Cookies.

Resources