1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

How to Change the Text Field of a Remote File?

Discussion in 'JavaScript' started by ivenms, Aug 31, 2007.

  1. #1
    Suppose:

    I made a page that had an IFrame on it.

    The IFrame's source file is a remote file.

    The main intension is to change the form field values of the IFrame page by running the JavaScript function I made on my page. This means that the IFrame's forms field will filled automatically.

    How is it possible.... :confused:

    Please help me.
     
    ivenms, Aug 31, 2007 IP
  2. garazy

    garazy Peon

    Messages:
    35
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Hi ivenms,

    It may not be possible purely because it is a remote location. I would attempt to get it working on a local file first, if you can make that work but it does not work on the remote page then you might be a bit stuck.

    Gary
     
    garazy, Aug 31, 2007 IP
  3. ivenms

    ivenms Peon

    Messages:
    334
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Is there any option available on this wide programming field to put contents on the text field automatically ( With remote files. Not saying about the text fields of same page.) ???? ????

    Please help me. Iam in deep trouble now.
     
    ivenms, Sep 1, 2007 IP
  4. webrickco

    webrickco Active Member

    Messages:
    268
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    60
    #4
    Your iframe file script is included inside your page? once included, remote or not, the iframe html is displayed into the browser and DOM is accessible for read and write when available.
    Based on that assumption, you can change the value of displayed fields simply by accessing their value property in javascript, by setting document.getElementById('fieldiniframe').value = 'something';. You can even place in your page a button associated to a function that would put defaults in all your fields.
     
    webrickco, Sep 4, 2007 IP
  5. ivenms

    ivenms Peon

    Messages:
    334
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #5
    I tried. But it doesn't works with IFRAME...

    For Example:

    Try to make an Iframe on your page with src=http://google.com

    Then try to change the value of the google search text field "q" from your page.

    I tried and I failed to change the text field value.
     
    ivenms, Sep 4, 2007 IP
  6. webrickco

    webrickco Active Member

    Messages:
    268
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    60
    #6
    well www.google.com is a page with its own headers, i do not believe in that case you can modify values from inside your page. What if the page you are including, is a body content only.

    I say this because i use a lot of includes on my pages and i can always change the child's values from the parents.
     
    webrickco, Sep 4, 2007 IP
  7. ivenms

    ivenms Peon

    Messages:
    334
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Iam searching for a new way to change the DOM value of a remote file with JavaScript.

    Still not able to make it success...
     
    ivenms, Sep 5, 2007 IP
  8. bibel

    bibel Active Member

    Messages:
    289
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    58
    #8
    You could only do this if the iframe was on the same domain as the parent window.
    Since it's not, the browser will not allow you to use javascript to change input values.
     
    bibel, Sep 6, 2007 IP
  9. webrickco

    webrickco Active Member

    Messages:
    268
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    60
    #9
    i really don't see why since the value of the elements you have to change are available at the browser level, regardless remote consideration.
     
    webrickco, Sep 6, 2007 IP
  10. ivenms

    ivenms Peon

    Messages:
    334
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #10
    I want to make an online automated form filling page..

    Thats why Iam looking for this stuff.
     
    ivenms, Sep 7, 2007 IP
  11. krt

    krt Well-Known Member

    Messages:
    829
    Likes Received:
    38
    Best Answers:
    0
    Trophy Points:
    120
    #11
    Use cURL, get the HTML of the page and manipulate that in your server side script and then display that. This saves a JS dependency and stops users from having the page load before the form fields are filled in.
     
    krt, Sep 7, 2007 IP
    webrickco likes this.
  12. bibel

    bibel Active Member

    Messages:
    289
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    58
    #12
    I'm not making assumptions, I'm just giving you the facts. Just do a search on cross-domain scripting
     
    bibel, Sep 7, 2007 IP
  13. webrickco

    webrickco Active Member

    Messages:
    268
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    60
    #13
    webrickco, Sep 11, 2007 IP
  14. ivenms

    ivenms Peon

    Messages:
    334
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #14
    That only gives the display. Iam looking for making automated form filler. Many sites doesn't allow post or get content from other parts. This idea will not work. Iam looking for JavaScript coding.

    Tried it. But not worked for me.
     
    ivenms, Sep 11, 2007 IP