Using Javascript to fill in forms

Discussion in 'Javascript' started by Guenther Sohler, Feb 12, 2007.

  1. Hallo,

    is it possible, to use javascript to automatically fill in forms,
    once a site is loaded ?
    that means, i would write a small html document, which has javascript
    embedded.
    it would first load a new site, and then fill out the forms by
    'form path'

    ???
    Guenther Sohler, Feb 12, 2007
    #1
    1. Advertising

  2. Guenther Sohler

    Erwin Moller Guest

    Guenther Sohler wrote:

    > Hallo,
    >
    > is it possible, to use javascript to automatically fill in forms,
    > once a site is loaded ?
    > that means, i would write a small html document, which has javascript
    > embedded.
    > it would first load a new site, and then fill out the forms by
    > 'form path'
    >
    > ???


    Hi,

    Yes, that is where JS is good at: forms.
    eg: to change the value of some textfield named 'mytext', in a form named
    'myform', try:
    document.forms.myform.mytext.value='new value';

    But you better get your hands on a good book, because the details of all the
    elementtypes is too much to describe. (radio, checkboxes, text, textarea,
    select, etc).

    'Javascript, the definitive Guide', by O'Reilly would be a good choice in my
    opinion.


    Regards,
    Erwin Moller
    Erwin Moller, Feb 12, 2007
    #2
    1. Advertising

  3. Guenther Sohler

    Randy Webb Guest

    Guenther Sohler said the following on 2/12/2007 9:55 AM:
    > Hallo,
    >
    > is it possible, to use javascript to automatically fill in forms,
    > once a site is loaded ?
    > that means, i would write a small html document, which has javascript
    > embedded.
    > it would first load a new site, and then fill out the forms by
    > 'form path'


    No, what you are describing can't be done. It is a security violation to
    try to script a document from another domain. If you are wanting it for
    personal use, you can use a bookmarklet that when clicked can fill out a
    form.

    --
    Randy
    Chance Favors The Prepared Mind
    comp.lang.javascript FAQ - http://jibbering.com/faq/index.html
    Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
    Randy Webb, Feb 12, 2007
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. John
    Replies:
    1
    Views:
    3,224
    Scott Allen
    Jul 26, 2004
  2. Bill Gower

    Need advice on online fill in forms

    Bill Gower, Feb 17, 2008, in forum: ASP .Net
    Replies:
    8
    Views:
    339
    Jesse Houwing
    Feb 18, 2008
  3. Jackie Wang

    Automatically fill in forms on line

    Jackie Wang, Mar 31, 2008, in forum: Python
    Replies:
    3
    Views:
    308
    Jason Scheirer
    Mar 31, 2008
  4. Toni Pohl
    Replies:
    1
    Views:
    936
    Toni Pohl
    Aug 10, 2008
  5. Eric
    Replies:
    2
    Views:
    501
Loading...

Share This Page