pass value to form element on a website

We have a web application ASP classic, in it a hidden form value. This is a 'receipt number'.
We need to pass this number to a government website form field so that it populates automatically (Don't need to submit their page - form), just so to avoid errors when people type it in.

How can I do this ?
Who is Participating?
Big MontySenior Web Developer / CEO of Commented:
you could use javascript to accomplish this:

<a href="#" onclick="document.location = 'govSite.html?recNumber=' + document.getElementById("hdnRecNumber").value;">submit to gov site</a>

Open in new window

Big MontySenior Web Developer / CEO of Commented:
if you're expecting any kind of response, then you would want to use AJAX. if that's the case, let me know and I can provide an example
Scott Fell, EE MVEDeveloper & EE ModeratorCommented:
If you have a form on site 1 that you control and site 2 has a form to accept data that you do not control, there is no way to get data in the form to auto populate unless that page is expecting outside input.
AleksAuthor Commented:
I don't have any control over site 2. Can it be done then ?
Scott Fell, EE MVEDeveloper & EE ModeratorCommented:
Only if site 2 has the ability to accept either form post or url get that accepts the id.  If that were the case then the type of javascript big monty gave you might work or simply linking to to would do the trick or if it is a form use method get- same thing.

If they don't have a way to convert a querystring or form input or have an api, then  your answer is simply, "you can't do that".
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.