I'm trying to figure out how to design some kind of interactive banner to
put on websites, where a visitor can actually enter his own details (like a
login or a password for example) IN the banner, and where upon submitting a
(new) browser window is generated with the entered data as variables in the
URL.
For example, the user enters the following details in the banner:
login: bill password: greta
When he submits this form he will be taken to
http://www.important.company.com/default.asp?login=bill&password=greta
You get the picture. Anyway, I was thinking of doing this in Java but since
I'm not a Java wizzkid I am looking for any kind of resources that can help
me out. Any help is much appreciated.
Nicolas Malfeyt
String urlString = "http://www.important.company.com/default.asp?";
String args = URLEncoder.encode(txtLogin.getText() + "&" +
txtPass.getText()); // get value from text fields.
urlString = urlString + args;
getAppletContext().showDocument( new URL(urlString), "newWindowName" );
Construct the URL from values in your text fields and then use the
showDocument()
method to display the content of that URL in another window named
"newWindowName".
If you don't want to name the new window, you can use
getAppletContext().showDocument( new URL(urlString), "_blank" );