+ Reply to Thread
Page 1 of 2 12 LastLast
Results 1 to 10 of 15

Thread: HELP how to: Pass value from a form to iframe

  1. #1
    kidcajes is offline x10Hosting Member kidcajes is an unknown quantity at this point
    Join Date
    Sep 2009
    Posts
    21

    HELP how to: Pass value from a form to iframe

    I have a payday.html with iframe in it:
    HTML Code:
    <html>
    <body>
    
    <iframe name="payday_info" src ="https://www.quote-advisor.com/iframe?i_type=payday&affid=8242&i_td1_color=bababa&i_td2_color=ededff&i_title_color=bfbfeb&i_submit_color=f0f0f5&i_width_td_left=20&i_width_td_right=80&i_width_table=100&i_align_left=&i_align_rigth=&subacc=1&i_width_table=100%" width="40%" height="460">
      <p>Your browser does not support iframes.</p>
    </iframe>
    
    </body>
    </html>
    in my index i need a textboxes for Name and Street Address and a Submit button. After the user enters the data and click the submit button it will open payday.html and displays the Name and Street Address in it.

    Can anyone help me with the code i really cant figure it out, been trying reading other forums but no luck. I am new to iframe and haven't tried it before. Your help is greatly appreciated, TNX

  2. #2
    ichwar's Avatar
    ichwar is offline Community Advocate ichwar is an unknown quantity at this point
    Join Date
    Dec 2008
    Location
    NC, USA
    Posts
    1,454

    Re: HELP how to: Pass value from a form to iframe

    Don't use iframes. Instead, use the php get() or post() function.

  3. #3
    smithee's Avatar
    smithee is offline x10Hosting Member smithee is an unknown quantity at this point
    Join Date
    Aug 2009
    Location
    NIMBY
    Posts
    45

    Re: HELP how to: Pass value from a form to iframe

    iframe's are handy for when you want to display a new page in a portion of an existing page, so you still view the original one. Therefore you can seamlessly have the form on the same page as the iframe, and have it submit it like that.

    It sounds like you want the form on the index page, and that leads to "payday.html" with an iframe... What will be in the iframe? The name and address? If so, why can't you put it on the same physical page as payday.html?

    Oh yeah, and one final thing... a PHP page will be better instead of an HTML, so therefore it'll be "payday.php". Then it will be able to receive the data from the form via $_GET[] or $_POST[], like what ichwar has just said.
    .

    Be nice to nerds. Chances are you’ll end up working for one. - Bill Gates

  4. #4
    kidcajes is offline x10Hosting Member kidcajes is an unknown quantity at this point
    Join Date
    Sep 2009
    Posts
    21

    Re: HELP how to: Pass value from a form to iframe

    Thank you very much guys for the suggestions. I understand that using php get and post is more appropriate to use. But i don't have a choice this is one of the assignment given to me by my professor.

    I need solutions here. PLEASE if there is someone who can help me solve this. I greatly appreciate it, THANK YOU in advance

  5. #5
    ichwar's Avatar
    ichwar is offline Community Advocate ichwar is an unknown quantity at this point
    Join Date
    Dec 2008
    Location
    NC, USA
    Posts
    1,454

    Re: HELP how to: Pass value from a form to iframe

    kidcajes, in that case, they you will have to use an iframe. Better yet, just tell your professor that iframes are clunky, messy and outdated, and that he shouldn't be making you use them when a php get() or post() will be so much simpler. ;)

    On the practical side, I did do something like that once, but I had to use javascript to do it. Are you allowed to use javascript?

  6. #6
    kidcajes is offline x10Hosting Member kidcajes is an unknown quantity at this point
    Join Date
    Sep 2009
    Posts
    21

    Re: HELP how to: Pass value from a form to iframe

    Yes, i think we are allowed.

  7. #7
    descalzo's Avatar
    descalzo is offline Grim Squeaker descalzo has a brilliant futuredescalzo has a brilliant futuredescalzo has a brilliant future
    Join Date
    Jul 2009
    Location
    Ankh-Morpork
    Posts
    7,636

    Re: HELP how to: Pass value from a form to iframe

    It's not really clear what you want to do.

    You have "index", you have payday.html. You have an iFrame.

    You want index.html with a submission form on it. Right?
    Submitting the form will send you to payday.html which will have an iFrame it in. Right?
    That iFrame will display the input from the form. Right?
    Nothing is always absolutely so.

  8. #8
    ichwar's Avatar
    ichwar is offline Community Advocate ichwar is an unknown quantity at this point
    Join Date
    Dec 2008
    Location
    NC, USA
    Posts
    1,454

    Re: HELP how to: Pass value from a form to iframe

    Quote Originally Posted by descalzo View Post
    It's not really clear what you want to do.

    You have "index", you have payday.html. You have an iFrame.

    You want index.html with a submission form on it. Right?
    Submitting the form will send you to payday.html which will have an iFrame it in. Right?
    That iFrame will display the input from the form. Right?
    Yes, I think that's what he wants. As far as I know, the best way to do this is with cookies. I'd code the whole thing up for you kid, but I think that since this is your school, you would be better off doing it yourself so that you would learn how to do these things in the future. ;)

    But I can help you with specific areas if you need help. Here's a good place to start: http://w3schools.com/js/js_cookies.asp
    Last edited by ichwar; 09-23-2009 at 05:12 PM.

  9. #9
    smithee's Avatar
    smithee is offline x10Hosting Member smithee is an unknown quantity at this point
    Join Date
    Aug 2009
    Location
    NIMBY
    Posts
    45

    Re: HELP how to: Pass value from a form to iframe

    Here's a little hint... to control iframe's from outside itself, give the iframe a name (which is "payday_info", so that's a good start) and any links/form buttons you want the page to load when the user clicks them, which is pretty obvious. To make it load into the iframe, you give the link/button a "target" variable which is assigned to the name of the iframe. For example:

    HTML Code:
    <a src="http://www.google.co.uk" target="payday_info">Click here to load Google into the iframe!</a>
    Not giving too much away obviously ;)
    Last edited by smithee; 09-24-2009 at 03:54 PM. Reason: Made a typo... gotta keep it error-free! :)
    .

    Be nice to nerds. Chances are you’ll end up working for one. - Bill Gates

  10. #10
    kidcajes is offline x10Hosting Member kidcajes is an unknown quantity at this point
    Join Date
    Sep 2009
    Posts
    21

    Re: HELP how to: Pass value from a form to iframe

    Quote Originally Posted by descalzo View Post
    It's not really clear what you want to do.

    You have "index", you have payday.html. You have an iFrame.

    You want index.html with a submission form on it. Right?
    Submitting the form will send you to payday.html which will have an iFrame it in. Right?
    That iFrame will display the input from the form. Right?

    Yes that is all i needed to do.

+ Reply to Thread
Page 1 of 2 12 LastLast

Similar Threads

  1. Need Help on a Form
    By secretply in forum Programming Help
    Replies: 4
    Last Post: 05-02-2009, 07:05 PM
  2. Call to function from action attribute of form tag
    By parkourmumbai in forum Programming Help
    Replies: 10
    Last Post: 10-14-2008, 06:47 AM
  3. Passing vars from parent to iframe
    By gottaloveit in forum Programming Help
    Replies: 8
    Last Post: 05-07-2008, 11:15 AM
  4. Addon Domain PHP Form Error
    By rockee in forum Free Hosting
    Replies: 2
    Last Post: 04-02-2008, 06:53 PM
  5. A simple Visual Basic Login Form
    By Zenax in forum Tutorials
    Replies: 0
    Last Post: 03-13-2007, 08:59 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers