Hi everyone,
I'm new here, referred by a friend. He recommended you guys, as no one else on other forums could help. I'm a fairly accomplished php programmer, and love joining forum communities, so I'm excited to find another one to join.
Here's my problem.
I have index.php which has a form on it. The form contains a drop down box, and a submit button. Clicking the submit button pulls a page from my other server. The page it pulls is just a form, on a white background, and needs to remain this way, as other members of my network access this page.
I need a way to pull that page into a seperate page called quote.php, so it can match the visual style of my site. My initial thought is to use an iframe on the quote.php page, but I can't figure out how to send the results to it.
I could do it if the iframe is on the same page as the form, just by using the target tag of the form. But on a seperate page? Must be a way to do it with javascript?
Thanks in advance,
Josh
Load form results into iframe on different page.
Moderator: General Moderators
-
sell-traffic
- Forum Commoner
- Posts: 26
- Joined: Thu Aug 05, 2004 9:35 pm
- CoderGoblin
- DevNet Resident
- Posts: 1425
- Joined: Tue Mar 16, 2004 10:03 am
- Location: Aachen, Germany
If I get your requirement correct, it is possible using javascript. It would need something like the following...
in HTML
The javascript
Three points to bear in mind.
1) No chance to test it, but should give you a starting point
2) Do you insist on users using javascript? If not you will need to rethink about opening a new window as this is not possible in php. As far as I know you would have to use frames.
3) I use an onChange event as I hate forcing users to click another button for a form submit when I don't have to.
in HTML
Code: Select all
<form target="target" method="method">
<select name="chooselist" onchange="javascript:openWin(this.value)">
<option value=1>Option1</option>
<option value=2>Option2</option>
</select>
</form>Code: Select all
function openWin() {
var new_win;
new_win=window.open('source','title',
width=400,height=600,left=500,top=100,
resizable=yes,alwaysRaised=yes,scrollbars=yes,
status=no');
if (new_win.location.href) {
new_win.focus();
}
}1) No chance to test it, but should give you a starting point
2) Do you insist on users using javascript? If not you will need to rethink about opening a new window as this is not possible in php. As far as I know you would have to use frames.
3) I use an onChange event as I hate forcing users to click another button for a form submit when I don't have to.
- CoderGoblin
- DevNet Resident
- Posts: 1425
- Joined: Tue Mar 16, 2004 10:03 am
- Location: Aachen, Germany
Just reread your question. Previous answer opens a new window not uses an existing one...
In javascript you need to find the window you require using a command such as childwin=parent.framename. Using this you then need to get the iframe name and set it.
childwin.framename.location("src");
Again no time to try it out but if you need additional help please give more details (such as the actual frames being used.
I am sure you will get an answer.
In javascript you need to find the window you require using a command such as childwin=parent.framename. Using this you then need to get the iframe name and set it.
childwin.framename.location("src");
Again no time to try it out but if you need additional help please give more details (such as the actual frames being used.
I am sure you will get an answer.
You could dynamicly change the src value of the iframe tag: ...then let page.php handle the $_GET data provided... Perhaps this can be applied to your solution aswell.
Code: Select all
<iframe src ="/page.php?value=something"></iframe>-
sell-traffic
- Forum Commoner
- Posts: 26
- Joined: Thu Aug 05, 2004 9:35 pm