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 ?
LVL 1
AleksAsked:
Who is Participating?
 
Big MontySenior Web Developer / CEO of ExchangeTree.org 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

0
 
Big MontySenior Web Developer / CEO of ExchangeTree.org 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
0
 
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.
0
 
AleksAuthor Commented:
I don't have any control over site 2. Can it be done then ?
0
 
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 http://somesite.com/url?id=abc312 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".

http://support.experts-exchange.com/customer/portal/articles/755964-the-experts-told-me-%E2%80%9Cyou-can-not-do-that%E2%80%9D-what-do-i-do-now-?b_id=44
0
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.