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.

form inside iframe ,submit button outside the iframe

Discussion in 'C#' started by borisding, Aug 17, 2006.

  1. #1
    Hi all,
    I have a form with few fields inside an iframe.
    yet, i wish to put my submit button outside the iframe (parent window)

    let say, i have a form in mydetail.asp
    In parent.asp file,
    i write <iframe name="myframe" id="frame1" src="mydetail.asp"></iframe>
    in parent.asp file. And, i put the submit button in parent.asp file.

    Now, i would like to press the button and submit the form data of the iframe and display my result in mydetail.asp(in iframe).
    How to do that?
    Any ideas or tutorials that can be refered?
    Thanks alot!!
     
    borisding, Aug 17, 2006 IP
  2. ccoonen

    ccoonen Well-Known Member

    Messages:
    1,606
    Likes Received:
    71
    Best Answers:
    0
    Trophy Points:
    160
    #2
    I believe you use javascript to emulate a form click in an iframe, but I'm not sure if you retrieve the data back into your parent. Actually, I bet if you did an onload event of the posted-to page in the iframe - that set the parent window it would be possible.
     
    ccoonen, Aug 17, 2006 IP
  3. ludwig

    ludwig Notable Member

    Messages:
    2,253
    Likes Received:
    66
    Best Answers:
    0
    Trophy Points:
    225
    #3
    I would suggest you not to use the iframe, use some styling and do what I have done for www.hay.am, its almost like the iframe thing but it functions on one and the same page.

    also if you don't need scrolling for your iframe, you could just include your mydetail.asp file into parent.asp
     
    ludwig, Aug 18, 2006 IP
  4. RadiantThunder

    RadiantThunder Peon

    Messages:
    1
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Hi,

    you can do what you are trying to achieve by giving the attribute 'name' to your iframe.
    And then put that name as a target on your submit button.

    example:
    <iframe name="myframe" id="frame1" src="mydetail.asp"></iframe>
    <form action="../mydetail.asp" method="post" target="myframe">
    <input type="submit" name="DoIt" value="DoIt">
    </form>
    
    HTML:
    Well at least I think that's what you want.
    Grtz, RT
     
    RadiantThunder, Aug 1, 2007 IP
  5. webcycloneindia

    webcycloneindia Active Member

    Messages:
    170
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    60
  6. Hostm2

    Hostm2 Peon

    Messages:
    34
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    You could use header() php instead for using iframe. it will work
     
    Hostm2, May 27, 2010 IP
  7. ludwig

    ludwig Notable Member

    Messages:
    2,253
    Likes Received:
    66
    Best Answers:
    0
    Trophy Points:
    225
    #7
    dude this is 4 years old thread and about ASP not PHP
     
    ludwig, May 27, 2010 IP