I've narrowed down what's going on, but still stuck...
this is how the form is being submitted (from inside of the component):
function stripeTokenHandler(token) {
var form = document.getElementById('payment-form');
var hiddenInput = document.createElement('input');
hiddenInput.setAttribute('type', 'hidden');
hiddenInput.setAttribute('name', 'stripeToken');
hiddenInput.setAttribute('value', token.id);
form.appendChild(hiddenInput);
form.submit();
}
it seems to me that document.createElement('input') doesn't create an
element under the topmost document (I don't really understand this well,
but when this code is in the main html - not in the component- it works
correctly and submits the proper data to the form action url)
I just can't think of anything else here - those variables that are
hardcoded in the form, i.e. not submitted via created on the fly in input
fields - are passed over correctly.
Greatly appreciate some help...
On Friday, May 31, 2019 at 2:38:06 PM UTC-4, Vlad wrote:
>
> I am loading a component with LOAD. the component has the form on it. the
> form is submitting via post method.
>
> request.post_vars is empty. the variables don't go through.
>
> when I copy the same very code and pasting it in the view (i.e. instead of
> the LOAD component - while taking the LOAD line out) - with not even a
> single change, just copy and paste -
> request.post_vars is correct - filled with whichever parameters are coming
> from the form.
>
> is this a feature or a bug? :)
>
> is there something subtle I am missing about those components? I've tried
> both - loading the component with ajax true and ajax false - same thing.
> And the same thing happens when I tried to submit with get method.
>
> Other than not having vars set - everything else functions right. The form
> is submitted...
>
> Any ideas?
>
>
>
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/web2py/2ebf7e18-a569-4c0d-91ef-ce7a3f7d1f9c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.