简体   繁体   中英

auto-populate another form using a link, it is possible?

I'm trying to make an app on Android that send an URI that auto-populate the "RFC Emisor" and "RFC Receptor" of this web page:

https://verificacfdi.facturaelectronica.sat.gob.mx , if I'm correct those two inputs have the id of:

  • ctl00_MainContent_TxtRfcEmisor

  • ctl00_MainContent_TxtRfcReceptor

I already tried this but it didn't work:

https://verificacfdi.facturaelectronica.sat.gob.mx/&ctl00_MainContent_TxtRfcEmisor=123456789&ctl00_MainContent_TxtRfcReceptor=123456789

there is a way to achieve what I want?

The short answer is no. The browser won't automatically detect the URL parameter and pre-populate any form fields. A back-end PHP / ASP.NET page can read the value from the request and generate the HTML fields with the specified values. Alternatively, the page could use JavaScript to set the field values when the document finishes loading.

But all of this depends on changes to the target web page. If you do not have the ability to modify that page, I'm afraid there's very little you could do.

You might be able to duplicate the form on your own page, and send the form data to the target—effectively bypassing the form on the other page and 'faking' your own, but if the target system does some kind of validation to prevent posting forms across domain names, this probably won't work either. You may have create the form and process it yourself, replicating the entire form interaction programmatically when a user submits a form to your server. In any case, none of these options are particularly graceful.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM