facebook registration plugin : populating custom fields - facebook

I have an HTML form that uses the Facebook registration plugin. I have a couple of custom text fields (the kind that are included in the iFrame itself).
Whether user prefills the form using Facebook. or enters the data himself, I am able to store all values in my database without.
At the end of my post method, I redirect to load the same page. At this point, I would like to populate the fields from the data in my database. By which I mean, if the user logs off Facebook, on this page, he should still see the data that he has submitted to my database.
How do I set values for the fields (both custom and regular fields) in the registration form?
Should I say document.getElementById('field_name').value = "hello"?

Well it depends which technology you are using to generate the pages. That would be good to know. You most likely would have the JSP/ASP/PHP prepopulate those fields with from the data as it sends the HTML to the user.

Related

How to display and return moodle course lesson content through moodle API?

I am trying to make custom app using the Moodle API.
How can I display and return courses of type lesson?
In my lesson, there is a choice type questions in between the lesson pages. The Moodle API (mod_lesson_get_page_data) returns the page content on two object properties viz, lesson_page_data->page->contents and lesson_page_data->pagecontent. The later contains HTML with buttons to submit the question, but when I click, the form is directed to the Moodle site and is asking to login. Instead I am looking for a solution to solve it in mobile itself without redirecting to site.
There are currently no (and probably never will be) methods to return whole offline lesson. You should use scorm for that task. However, why don't you replace all links in html with your own and write a small script that simply gets all parameters, creates and executes curl request and returns html?

Using ninja forms, how can I persist field values across pages?

I have a form on the home page of quotedjobs.com that I would like to persist the field values of across pages.
For example: A user enters some values in fields, such as job title (textbox), job type (list) and job description (text field). Underneath that I ask users to register on the site, but they have the option to click a link to allow them to login if they are already members.
What I would like to be able to do, is to redirect users to another form that is a copy, but allows them to login instead of register, but keep hold of the values that they entered in the title, type and description form of the previous page so they aren't losing their work.
I have seen the ninja_forms_processing variable in the docs, but I'm not clear on how to use that.
TL;DR - You can't.
As it was slim pickings here, I sent an email over to support. Got this response:
Hello,
At this time this use case is not possible in Ninja Forms. The plugin is currently unable to transfer data from field to field or between forms.
I’m sorry that we do not have a better solution for you at this time.
Thank you,

Split Sonata User Bundle registration form into stages

I'm currently working on a user registration form for a site I'm working on. The site requires a lot of information about users up front, and I'd like to break it down into stages.
The first stage requires the user to put in an identifier in the form of an order number. I would then check the order number exists in the system before making them continue to fill in the rest of the fields. I'm not sure how to go about doing this.
What I've managed so far though is to override the underlying User, RegistrationController and RegistrationFormType and render out a customised view with the relevant form fields.
An overview of the process I'd like would be:
FORM: ask for order number
process form and check order number exists (if not go back to 1)
FORM: ask for user information
process user information and store
complete
Simplest way of doing it will be to override registration template, and hide all fields except those you wanna show in first.
And than add some js validation rules, - to show up parts of form based on values prefilled by user. In that case you do not need to rework Sonata registration form, but for user experience it will be the same.

Why are Google Analytics Values being passed on a form submit?

My company's app builds simple forms that people can use on their websites to get information into our app. We have a generic form response script that each of these forms submits to, to gather and parse the webform responses.
We're encountering form values that look a lot like the values in Google Analytics cookies (utmz, utmsc, utmccn) The cookies are clearly not part of the form fields. The form is being done with a simple HTML form submit, so I'm at a loss how these values are getting appended on to the post.
Here's a sample form submission:
http://website.com/submit.php?&clientGuid=2342342abcde23423423&webformid=12&prospect_id=12345&custom_Register_or_Dance_the_Chicken=Register&__utma=84164169.205192989.1344888984.1346176569.1346178936.47&__utmc=84164169&__utmz=84164169.1344888984.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none)
Under what circumstances would a browser submit cookies along with a form submit? Is there a way to prevent it?
This looks like cross-domain user tracking... From the Google Analytics docs for _linkByPost():
The _linkByPost() method passes the GATC cookies from the referring form to another site in a string appended to the action value of the form (HTTP POST).
If there's no onsubmit='...' code directly on the form, it might be attached via jQuery or some other method.
It may be due to Google Chrome adding them to your form variables on submission...

Zend Framework: How to POST data to some external page (e.g. external payment gate) without using form?

I would like to have a user redirected to an external credit card gate. Of course I have to POST some user info to that gate, but I don't know how exactly can I do this.
I know that I could do this by generating a html form with hidden or read-only fields and have a user click "Submit" button. But this solution is not perfect, because all the form data could be easily changed using e.g. Firebug. I think you cannot do this using $this->_redirect(...). But maybe there is some other solution?
Many thanks for any tips or suggestions.
I would like to have a user redirected to an external credit card gate. Of course I have to POST some user info to that gate, but I don't know how exactly can I do this.
Using a form is the only method available. The RFC states that the user should explicitly agree to sending a POST (i.e. click on a submit button).
I know that I could do this by generating a html form with hidden or read-only fields and have a user click "Submit" button. But this solution is not perfect, because all the form data could be easily changed using e.g.
It is no more secure that using a redirect as the header data can be modified without too much of a problem. There are even Firefox plugins to do it.
use cURL to post data
http://framework.zend.com/manual/en/zend.http.client.adapters.html