By dazmcg on
Hi, I'm trying to write a module where the user will submit a link (say to IMDB) and then this will go off and use the IMDB API or scrape the page, filling in the rest of the values on the form.
I want to do this in two steps - fill in the URL value, then have a button 'retrieve info' which will then populate the fields, but leaving the form as unsubmitted yet, so the user can review/add additional information.
Any tips on how to achieve this multi-step process?
Being able to call a form with pre-specified values (without having those values in the URL) would be helpful as a basic possibility? Can this be achieved passing the info around $form_state?
Cheers!
Comments
I am also trying to do the
I am also trying to do the same thing. I tried doing the following but it doesn't work:
In the productinfo_fill_info function, I tried altering the $form_state['values'] array and I also tried altering the $form itself. But neither of these seem to work.
Any advice is appreciated.
Made a bit of progress. If I
Made a bit of progress. If I set $form_state['rebuild'] = TRUE, then I can modify the values in $form_state. (Not 100% sure why this is the case.)
For example,
For some reason, some existing fields such as the title and the taxonomy select box are getting reset. I'm not sure why this is the case.