Jump to content

Using form responses in the parent frame


Calamier
 Share

Recommended Posts

Sorry if this question has been asked already, i've done quite a bit of research and found nothing. Here goes...I have a page that is just a regular page with one iframe. The one frame is simply a scrollable list of our inventory. I need my customers to be able to scroll through this list and select the car of their choice, and then have the form info, which is a radio button, displayed in the form that submits when they click the submit button at the bottom of the page. I have tried this code :<input type="radio" name="Car" value="1998 Kia Sephia M105A" target="_parent"/>This did not work. The page is viewable here (the frame is just under step 2) : www.rocksolidautocenter.com/drive_edit.htmlThe image is not so important, feel free to submit the form if you like.Also, if you look at www.rocksolidautocenter.com I'm researching ways to get the page centered and looking correct, i designed it on a 1280x960 res and learned that the rest of the world is still using 800x600 and 1024x768. Any and all input is appreciated, no pun intended.-Calamier

Link to comment
Share on other sites

What are you submitting to? And what are you using to submit it there, if you are just using the HTML tags, then there is your first problem. If you want to submit the information to a database then you will need to use a server-side language such as ASP or PHP.If you just want the information e-mailed somewhere, then I would suggest using Javascript.Also, see this thread for e-mailing:http://w3schools.invisionzone.com/index.php?showtopic=657

Link to comment
Share on other sites

I've already got the form working. It's a form that submits to an email address via a cgi script called formmail, it's pretty common. That's not really the point though... What i'm looking for is the code I would use to render form response from a frame into the actual form on the page the frame is contained in. if you look at the source from the page it should be self-explanitory.I want the radio button under the "1998 Kia Sephia" i want that radio button to enter the response into the form on the page, along with the responses from steps 1 3 and 4.

Link to comment
Share on other sites

I think you are looking for something like this:

 Make sure that the form has the target set as name of the frame...<form name="MyForm" target="FrameName">...then in the submit button in the frame ...<input type="radio" name="Car" value="1998 Kia Sephia M105A" onclick="parent.MyForm.submit();return false;">

maybe?

Link to comment
Share on other sites

Nah, that didn't work. At first when I set the target=FrameName(main) the submit button on the bottom of the page didnt work, then i tried doin it without it and it didn't work. Is there anyway I can simply set the radio button in the frame to target the parent form? ex. <form target="MyForm" ...etc....>?

Link to comment
Share on other sites

are you trying to change the values of the form on the parent page or are you trying to submit data from the child frame to the parent window?sorry, I'm having trouble figuring out where the "action" (values being used/submitted) takes place.

Link to comment
Share on other sites

I think what he means is the main page needs to access form information from the iframe inside the page.

yeah, but is the requirement to just have information from the <iframe> set the values of the form in the parent without submitting it or set it and then submit it or submit the values to the parent window to process it to regenerate the parent form?
Link to comment
Share on other sites

When he submits, he wants to be able to access the information in the iframe from the parent page, right?

So we need to add this one to the list of scenarios - the parent window posting to the <iframe> or parent window updating the <iframe> form so that the <iframe> window can post . . . somewhere. :) where is this guy, now we need his help! :)
Link to comment
Share on other sites

Skemcin almost hit it, sorry I havent been checking back often im a busy guy.Here is how it is supposed to work... ->Step 1 the customer picks the programStep 2 picks a car, the iframe will hold about 60 different cars (the picture and short description) with a radio button under each. Selecting a radio button for a car would then enter a form value that gets submitted after steps 3 and 4 are completed. If you go here :www.rocksolidautocenter.com/drive_edit.htmlYou can see what i have put in it's place because i couldn't get it to work. So the scenario is :The parent frame holds a form, well call it MyForm. MyForm has several inputs, and an iframe which is the child, the child has 1 of 60 or so options that needs to be selected, and once selected, included in the parent frames form we named MyForm. Preferably in some sort of hidden way. So thats that.

Link to comment
Share on other sites

Skemcin almost hit it, sorry I havent been checking back often im a busy guy.

hey no worries, I'm just poking fun at myself and chocolate570 trying to figure out what we need to figure out . . .:)Anyway, so, to get this right, you have your 4 step/part form. Step 1, 3, and 4 are in your parent window and step 2 resides in your <iframe>. Essentially the value selected from the <iframe> is the value that you want to be set for step 2 when the parent window/form is finally submitted.If this is the case, this means that the <iframe> would never be submitting any form, and the javascript you need there will simply be triggered by the "onclick" attribute. That will run a function to set the value of the hidden field in the parent window.Having said that, here is how someone else has done it:http://www.codeproject.com/jscript/dynaframe.aspYou will, with this example, have to reverse the process they are using. This example is set up to have the parent window update the frame value - so you will just have to review the code to understand how it was done and apply the same logic in reverse.Hope that helps. :)
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...