473,396 Members | 1,853 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

automatic submission of forms

hi
Is ther anyway i can automatically fill out forms and submit them thru
java?
supposing i hav a normal txt file that contains all data that needs to
be filed out into the form, is there anyway i can fill out a form and
submit it automatically by providing only the URL of the form and the
txt file?
thanks
Najla

Mar 27 '06 #1
7 2958
gr******@yahoo.com wrote:
hi
Is ther anyway i can automatically fill out forms and submit them thru
java?
Java?
Yes, you can make forms in Java, and by means of applets you can even show
them in a webpage. But I seriously doubt if that is what you want.
If so, visit a Java newsgroup, like comp.lang.java.help, it is good.

I think you mean Javascript. (In that case, this is the right newsgroup.)
supposing i hav a normal txt file that contains all data that needs to
be filed out into the form, is there anyway i can fill out a form and
submit it automatically by providing only the URL of the form and the
txt file?
Not by means of Javascript, because Javascript does not have access to your
textfile. Javascript is crippled intentionally when it come to local
fileaccess for securityreasons.

You better look at a serverside solution, using something like PHP.

Regards,
Erwin Moller
thanks
Najla


Mar 27 '06 #2
Cases: Java : wrong news group. Also, Java cannot fill in forms of a
web page unless that page was generated by JSP, and that will be done
before the page is displayed, supposing your text file is on the
server. But that defeats the point, so I am supposing your file is on
your hard drive

javascript: AJAX
You can request a file from the server using XMLHttpRequest
This would mean your text file would already be on the server
In this case, you might as well provide a <input type="file" /> and
upload that. You can write then a PHP script to parse that file.

SO
solution in javascript: none
solution in Java: yes, via Applets (ref Erwin's post)
solution in PHP: probably, provided PHP is activated on your server and
depending on what you want to do with the data.

Mar 27 '06 #3
AndrewTK wrote:
[...]
javascript: AJAX
You can request a file from the server using XMLHttpRequest
True.
This would mean your text file would already be on the server
Not necessarily.
In this case, you might as well provide a <input type="file" /> and
upload that. You can write then a PHP script to parse that file.
True.
SO
solution in javascript: none


Nonsense.
PointedEars
Mar 27 '06 #4
Thomas 'PointedEars' Lahn wrote:

<snip>
SO
solution in javascript: none
Nonsense.


Hey PointedEars,

Why do you say what Andrew wrote was nonsense?
I mean, how do you suggest the OP fills in his form using values from a
textfile somewhere, using only Javascript?
Or were you refering to an AJAX-like solution?

Me curious.

I saw you write lots of sensible stuff in here, so I guess you have some
trick up your sleeve. :P

Regards,
Erwin Moller


PointedEars


Mar 27 '06 #5
Erwin Moller wrote:
Thomas 'PointedEars' Lahn wrote:
SO
solution in javascript: none Nonsense.


[...]
Why do you say what Andrew wrote was nonsense?


Well, whether this statement qualifies as nonsense (or being wrong) would
depend on what is meant by "solution in JavaScript". Certainly there is
a solution /with/ JavaScript (or another ECMAScript implementation) that
involves a host object (e.g. an implementation of IXMLHttpRequest), and
from someone who uses the AJAX (Asynchronous JavaScript and XML) buzzword
I understand "in JavaScript" as "with JavaScript".

But even if I understood "in JavaScript" as "only with an ECMAScript
implementation and no other programming language involved" it would be
wrong, because the AndrewTK's preconception that the resource must be
accessible from a (HTTP) server is wrong. IXMLHttpRequest implementations
(and other host objects) can be used without XML and HTTP. The OP's
description is not clear enough to exclude anything here.
I mean, how do you suggest the OP fills in his form using
values from a textfile somewhere, using only Javascript?
Or were you refering to an AJAX-like solution?


The latter.
PointedEars
Mar 27 '06 #6

AndrewTK wrote:
Cases: Java : wrong news group. Also, Java cannot fill in forms of a
web page unless that page was generated by JSP, and that will be done
before the page is displayed, supposing your text file is on the
server. But that defeats the point, so I am supposing your file is on
your hard drive

javascript: AJAX
You can request a file from the server using XMLHttpRequest
This would mean your text file would already be on the server
In this case, you might as well provide a <input type="file" /> and
upload that. You can write then a PHP script to parse that file.
1. Text file on the server - will require a server side script to
return the file. This script can prefill the form withou the help of
JS.

2. Text file local by uploading to the server - again, JavaScript not
necessary

3. User pastes the content of text file into textarea - JavaScript can
parse it into appropriate fields. No server side script necessary.

SO
solution in javascript: none
solution in Java: yes, via Applets (ref Erwin's post)
solution in PHP: probably, provided PHP is activated on your server and
depending on what you want to do with the data.


Mar 27 '06 #7
Roman Ziak wrote:
1. Text file on the server - will require a server side script to
return the file. This script can prefill the form withou the help of
JS.

2. Text file local by uploading to the server - again, JavaScript not
necessary
But possible. J(ava)Script can be server-side.
3. User pastes the content of text file into textarea - JavaScript can
parse it into appropriate fields. No server side script necessary.


4. A host object is used to access the local text file. The ECMAScript
implementation can parse the content string it into appropriate fields.
No server-side script necessary.
PointedEars
Mar 27 '06 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Alex Hunsley | last post by:
I'm using urllib to post data to a web form by issuing a command similar to this: filename, headers = urllib.urlretrieve("http://www.thewebsitenamehere.com/servlet/com.blah.bloo.XmlFeed",...
2
by: Logical | last post by:
I have a form which houses basic inputs, as well as a few multiple select forms. I need to parse all the 'values' which are in this multiple select form (it gets manipulated dynamically client...
1
by: Piotr Kurpiel | last post by:
Hi, I am creating a site where I need to refer to another external file (aspx). I create the form and works fine. But as soon as I try to submit the form automatically (with form.submit()) I get...
12
by: Stanley | last post by:
Hi, I'd like to write a HTML page which can help me directly log in my Yahoo!mail or Gmail account without typing user name and password. Basically, I want to set up a link, click it and pop up...
3
by: Victor | last post by:
Dear Members I'm new here. Please permit me to ask some newbie question I'm from a non-profit organization, working for gender equality. We wish to get a small message across to sister blogs...
7
by: degmsb | last post by:
With Java script when a user hits submit on a form on my site, is it possible to take the values from the form and submit them to another form on another Url without the user who submitted the form...
1
by: grpmangr | last post by:
hi Is ther anyway i can automatically fill out forms and submit them thru java? supposing i hav a normal txt file that contains all data that needs to be filed out into the form, is there anyway...
1
by: Homer | last post by:
Hi, I just got a requirement from my HR department to automate their form submission process and integrate it into the Intranet project that I had just completed Phase 1 of. Because of the...
2
by: sitvasu | last post by:
hi, i am srinivas (new to this forum). i have an application in java, which has to submit forms automatically. can some body please help me in finding the relevant API to use. thanks in...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.