Paul:

Something like this may work; we have a similar logic working elsewhere (on
code we control).

As I understand your question, two implementations are possible. Both assume
knowledge of external html Form source code.

FIRST IMPLEMENTATION: Automate form default values for user input.

    We use code that allows us to fill-in forms that we control. The logic
seems applicable to any form code, following something like this pseudo
code:

    1) JSP/Servlet opens second page url; reads source into local String
var, say strVar.
    2) Look for input vars (find strVar.indexOf( somevarname )
    3) Find positions of related html <input> tag (index of nearest < and >
tag delimiters)
    4) replace entire <input ...> tag with a <input name=... [value] >
string for somevarname
    5) send strVar as response to client

SECOND IMPLEMENTATION: Automate second Form POST from first Form data (does
not require user input).

    (This would be like having form ONE capture information to be posted so
an external server, say as an automatic submission to Yahoo.com, for
example.)

    Simply create hidden html form with the new data and post it to the
external form server... (I think Real Gagnon
(http://tactika.com/realhome/realhome.html) discusses Post to a url. If not,
someone else here has posted information on how to do it -- check the
archives.)

Your choice of languages for either of these implementations; Java is my
preferred choice -- much easier to do in Java than in C and I think
performance is comparable. ( Zhu Jiang suggested JavaScript; don't know if
his idea is plausible and can find no reason to use client side technology
in this application. Besides, this is a server side technology group ;-)

If you need help or an example, let me know.

Good luck.

Phil

-----Original Message-----
From: wee kb <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED] <[EMAIL PROTECTED]>
Date: Wednesday, March 22, 2000 2:49 AM
Subject: Re: Automatically Submitting Forms


>Broken link!
>
>At 09:58 AM 3/22/00 +0200, Zhu Jiang wrote:
>>You can just use Java Script to do that work. check out Java Script object
>>road map you can find the answer.
>>
>>here is a link:
>>
>>http://developer.netscape.com/viewsource/goodman_ssjsrmap/goodman_ssjsrmap
.h
>>tml
>>
>>
>>zhu jiang
>>
>>-----Original Message-----
>>From: EXT Paul Allton [mailto:[EMAIL PROTECTED]]
>>Sent: 19. March 2000 11:03 PM
>>To: [EMAIL PROTECTED]
>>Subject: Automatically Submitting Forms
>>
>>
>>I have a form and I want to collect some info on it and based on that info
I
>>then want to got to a second page and prefill the form elements with that
>>data.  Then I want to submit that form.
>>
>>The problems:
>>1) this all needs to happen automatically
>>2) the second page is an external link and the source code therefore
cannot
>>be altered.
>>
>>Using JSP or a servlet whats the best way to prefill the form and post it?
>>Can it be done?
>>
>>If it cant be down using Java, can it be done with Javascript, PERL, cgi -
>>anything?
>>
>>==========================================================================
=
>>To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
>JSP-INTEREST".
>>Some relevant FAQs on JSP/Servlets can be found at:
>>
>> http://java.sun.com/products/jsp/faq.html
>> http://www.esperanto.org.nz/jsp/jspfaq.html
>> http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
>> http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
>>
>
>===========================================================================
>To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
>Some relevant FAQs on JSP/Servlets can be found at:
>
> http://java.sun.com/products/jsp/faq.html
> http://www.esperanto.org.nz/jsp/jspfaq.html
> http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
> http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
>

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to