File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes HTML, CSS and JavaScript and the fly likes *display* passed values in webpage form Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "*display* passed values in webpage form" Watch "*display* passed values in webpage form" New topic

*display* passed values in webpage form

Stephen Huey
Ranch Hand

Joined: Jul 15, 2003
Posts: 618
I'm sending my JSP/servlet website users to an external webpage (which is an ASP page), and I want to automatically fill out a form on the other site by passing form values as parameters in the URL. I'm trying to do that, and I may be doing it correctly, but I'm wondering if there's any way I can get it to display my passed values in the form field textboxes, or if that's impossible since it's an ASP page and their values in the outputted HTML are already hardcoded to nothing. For instance, here's the one for the phone area code:
<input type="text" name="F10089" size="3" maxlength="3" value=""> length
I'm trying to use this URL:
When I use this URL, the fields simply remain blank.
I'm guessing folks usually always submit at the same time as passing values to a form, and so maybe that's why it's not working. I don't want to submit it yet b/c I want to give the user a chance to double check the values. (I also want to test to make sure I'm passing appropriate values).
[ August 20, 2003: Message edited by: Stephen Huey ]
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63548

Unless the target page has specific server-side or client-side code to take your request parameters and stuff them into the form fields, no such pre-filling is possible. On its own, HTML will not match up incoming request parameters with form fields of the same name.
And since it is an external page, there's not much you can do about it. (If the page existed in the same domain, you could possibly open the page in an iframe or another window and manipulate it with Javascript -- but that's only allowed between pages in the same domain).

[Asking smart questions] [About Bear] [Books by Bear]
I agree. Here's the link:
subject: *display* passed values in webpage form
It's not a secret anymore!