HTML form fill

This is really a combined Java/HTML question;

I have a Java app I'm writing and it will require a license. To request a license, the java opens a particular website where the user will fill in some html forms and click "submit". So far, no problems.

But, there is a long license request key, and I'd like to avoid making the user type this in by hand - I want the java to pass the key to the webpage and fill in that value automatically.

Is there a way to do this?

[491 byte] By [seabhcana] at [2007-11-27 8:07:44]
# 1

Off the top of my head a quick way to do it would be to format the url to carry a parameter and use Javascript/Perl/PHP to fill in the value.

Example (append the license to the url)

http://www.yourpage.com/yourform.htm?12345565656

On the page:

<script language =" javascript">

var query = window.location.search.substring(1);

function getLicense() {

if(query != '')

//Set the value of your input box with the value of query

}

</script>

-Jordan

jwarzecha at 2007-7-12 19:50:29 > top of Java-index,Core,Core APIs...
# 2
I thought of that, but I wanted to avoid the hassle of changing the webpage (which I don't have direct access to)I would prefer a totally java based solution if one is possible. Thanks for your reply though
seabhcana at 2007-7-12 19:50:29 > top of Java-index,Core,Core APIs...
# 3
You could always do your form as part of the Java application and POST the information to the script that handles the html form, just a thought.-JordanMessage was edited by: jwarzech
jwarzecha at 2007-7-12 19:50:29 > top of Java-index,Core,Core APIs...
# 4
Ya. That might work. Thanks.
seabhcana at 2007-7-12 19:50:29 > top of Java-index,Core,Core APIs...