How do I confirm a data entered in a form with webviewer?

Hi everyone, I'm trying to fullfill this form with webviewer.RunJavaScript lines

https://telemanagrafici.agenziaentrate.gov.it/VerificaCF/Scegli.do?parameter=verificaCfPf

but when I submit a value for the id “comune”, corresponding to the box “comune o stato estero di nascita”, the box fullfilled remains gray returning an error when I submit the form like I would have to confirm it.


It might help if you show us the full javascript you are running, so we can see the test, and the action?

Did you know that you can pass values to a webviewer using the webviewstring ?

This is an easier version of the app with the full code of the line that gives the error

Download those blocks and post them here

Please download and post each of those event block(s)/procedures here ...

sample run downloading blocks

sample run uploading blocks

P.S. These blocks can be dragged directly into your Blocks Editor workspace.

See Download Block Images for a demo.

A screen shot of the blocks loses their ends as ...

That's why we need the entire blocks.

.

I think I see the problem (I have not actually used this technique myself, I only see the pattern in the back and forth between the AI2 side and the web service.)

The sample I posted has at most maybe 2 trips back and forth to the web site:

  • Get the form
  • Fill out the form and submit it.

Notice in the sample that in the second trip there is a big text JOIN pulling together all the parts of the form with their inuts and at the end a request to fire the button on the web page?

That is quite different from how you packaged your interactions. Yours looks like trying to get your drivers license from the Department of Motor Vehicles by post card, instead of standing there at the window with all your forms filled out.

It would be better, and much easier, to send all the variables using a webviewstring, and use javascript in the html file to disperse them to each input.

One could also do all this in AppInventor and send the data directly to the php file that is processing the form.

I agree.

But this looks like governmental form, judging by the URL, so that might not be an option.

1 Like

Playing with the actual form, it looks like the " Provincia di nascita:" has to be set before you enter the value in " Comune o stato estero di nascita:". Do it in that order and it should work. Also the second value above has to be in the region of the first value ?

Try this, seems to be working here, the "comune" box is not greyed out. Reducing the number of RunJavascript calls is probably helpful as well.

The change event was needed on the element "prov"


itgovform.aia (2.7 KB)