PowWeb Forums - The Perfect Community for the Perfect Host  

Register now to interact with over 11,000 members! Registered users have Posting Privileges, free access to Private Messaging, Email Notifications and more.

Go Back   PowWeb Community Forums > Web Site Design > HTML/CSS/Javascript
User Name
Password
Register FAQ Members List Search Today's Posts Mark Forums Read

Closed Thread
 
Thread Tools
Old 10-22-07, 05:58 PM   #1
aclips
Registered
 
Join Date: Oct 2007
Location: Portugal
Posts: 5
Reputation: 0
Question Getting a form result into a Iframe

Hello all!!

I have a form that gets information from an external server and i need the results to be displayed on a Iframe under my website. It may be in a Iframe or displayed on a another page in my website, here a bit of the code i have :

<form action="http://external.server.feeder.htm" method="GET" name="f" id="f" >
<input type="hidden" name="LPR" id="LPR" value=0>
<input type="hidden" name="MPR" id="MPR" value=0>

.
.
.
.

input type="submit" value="Search" class="button" name="submit" id="submit" target="results"></td>
<td><input type="reset" value="Reset" class="button" name="limpar" id="limpar"></td>

</form>

I hope you can help me on this

Kind Regards

Aclips
aclips is offline  
Old 10-22-07, 07:27 PM   #2
satis
 
satis's Avatar
 
Join Date: Oct 2002
Location: Dallas
Posts: 2,914
Reputation: 311
If you're just trying to target a frame or iframe with a form, you can give the form tag a target attribute

ie: <form action="http://blahblahblah.com" target="myiframe">
__________________
Satis Clankiller
Clankiller.com Forums
Clankiller.com
PlasmaSky.com
satis is offline  
Old 10-23-07, 03:20 AM   #3
aclips
Registered
 
Join Date: Oct 2007
Location: Portugal
Posts: 5
Reputation: 0
Quote:
Originally Posted by satis View Post
If you're just trying to target a frame or iframe with a form, you can give the form tag a target attribute

ie: <form action="http://blahblahblah.com" target="myiframe">
Hi satis, thanks for replying, i have done that but it is not showing on the iframe, its keeps opening a new page, here's the code i'm using:

<form action="http://external.server.feeder.htm" method="GET" name="f" target="results" id="f" >
<input type="hidden" name="LPR" id="LPR" value=0>
<input type="hidden" name="MPR" id="MPR" value=0>
.
.
.
input type="submit" value="Search" class="button" name="submit" id="submit" target="results"></td>
<td><input type="reset" value="Reset" class="button" name="limpar" id="limpar"></td>

</form>

"hidden" iframe, to post results:

<iframe width="0" id=”results” name="results" height="0" border="0" frameborder="0" scrolling="auto" align="center" hspace="0" vspace=""></iframe>

Regards

Aclips
aclips is offline  
Old 10-23-07, 08:55 AM   #4
troycawley
You are what you is...
 
troycawley's Avatar
 
Join Date: Nov 2006
Location: Wildwood, NJ
Posts: 245
Reputation: 85
...or directly call the page you are "get" requesting with
HTML Code:
<iframe src="http://external.server.feeder.example.com?LPR=0&MPR=0&var3=phoney&var4=baloney"></iframe>
__________________
-Troy
CAM Web Design

Last edited by troycawley; 10-23-07 at 08:55 AM.. Reason: added code tags
troycawley is offline  
Old 10-23-07, 07:55 PM   #5
aclips
Registered
 
Join Date: Oct 2007
Location: Portugal
Posts: 5
Reputation: 0
troycawley

Thanks for repying,

But the form is intended to get some information form the external server database, so a direct url can't be used...

aclips
aclips is offline  
Old 10-25-07, 08:28 AM   #6
satis
 
satis's Avatar
 
Join Date: Oct 2002
Location: Dallas
Posts: 2,914
Reputation: 311
a few things...

the targeting a form into an iframe works. Here's some example code:
PHP Code:
<form action='http://cnn.com' target='test'>
<
input type='submit'>
</
form>

<
iframe style='width: 150px; border: 1px solid #000000;' name='test'></iframe
In your last post you state "But the form is intended to get some information form the external server database, so a direct url can't be used...", but that's exactly what you're doing. When you submit the form, the client is sending a GET request directly to the external server.
__________________
Satis Clankiller
Clankiller.com Forums
Clankiller.com
PlasmaSky.com
satis is offline  
Old 10-25-07, 01:53 PM   #7
aclips
Registered
 
Join Date: Oct 2007
Location: Portugal
Posts: 5
Reputation: 0
Quote:
Originally Posted by satis View Post
a few things...

the targeting a form into an iframe works. Here's some example code:
PHP Code:
<form action='http://cnn.com' target='test'>
<
input type='submit'>
</
form>

<
iframe style='width: 150px; border: 1px solid #000000;' name='test'></iframe

Quote:
Originally Posted by satis View Post
In your last post you state "But the form is intended to get some information form the external server database, so a direct url can't be used...", but that's exactly what you're doing. When you submit the form, the client is sending a GET request directly to the external server.
Sure but how can i know the exact url, if the form can get 10 diferent informations from the external server, or can just get 1, example:

the webpag: www.bestsilvercoast.com
the quick search form is were the client selects what we wants to look for, then the result should be presented to a 1by1 iframe:

All options form request:
A few options selected:
This way i cant get a consistent url to directly post on the iframe, right?

Thanks

Aclips
aclips is offline  
Old 10-27-07, 12:41 PM   #8
satis
 
satis's Avatar
 
Join Date: Oct 2002
Location: Dallas
Posts: 2,914
Reputation: 311
I'm not really sure what you're trying to accomplish. Regarding the GET url you're trying to send to your iframe, that's the whole point of the form... ie
PHP Code:
<form action='http://paginas.imoguia.pt/constantinogomes/kitservidor/en/listagem.htm' target='test'>
<
input name="nat">
<
input name="typ">
<
input name="bus">...etc
<input type='submit'>
</
form
...replacing your inputs with checkboxes or radio buttons or whatever else is appropriate. Then when the click submit the end user's GET requests gets sent directly from their PC to the destination url (ie, paginas.imoguia.pt). That page then opens in the iframe.

What are you trying to do? Just give easy access to the page or are you trying to do something with?
__________________
Satis Clankiller
Clankiller.com Forums
Clankiller.com
PlasmaSky.com
satis is offline  
Old 10-27-07, 01:38 PM   #9
aclips
Registered
 
Join Date: Oct 2007
Location: Portugal
Posts: 5
Reputation: 0
Ok i'm following you.

The present webpage bellongs to a real estate agency that uses an online company to host their publicity, like this:

TopCasas -> is the Real estate company
Imoguia -> is the hosting company that has a software online and offline to upload and update all the properties that Topcasas has to offer.

Then they provide an "external" server that can be used to post the porperties from topcasas, with the external server kit i'm trying to build an website, that provides all the information and forms to search a specific property that is hosted on the Imoguia database. This way i intend to use a simplyfied from to provide clients a quick search for what they are looking for.

So i need the result from the quick search form to be posted on a iframe that inicially is hidden (1by1) when the form options are choosed and the submition buttis is pressed.

I hope you undersant my explanation, has my english is not that good.

regards

Aclips
aclips is offline  
Old 10-28-07, 07:16 PM   #10
satis
 
satis's Avatar
 
Join Date: Oct 2002
Location: Dallas
Posts: 2,914
Reputation: 311
ok...well, that code should work. You would need to add some javascript to your form that will resize your iframe when the form is submitted. Otherwise it'll always be 1px x 1px which kinda renders the iframe pointless. Or you could use javascript to dynamically create the iframe....or you could even use javascript to get the values of the form, open an asynchronous connection to the sight, then dynamically take the result and append it to your page.

The last is probably the coolest but also takes the most work. The way you're doing it is probably the easiest.

My recommendation is to start by making your iframe a decent size and just tuning your form until it does what you want it to do. Once you have it functional, then you can deal with making the iframe small to begin with and dynamically update when the form is submitted.
__________________
Satis Clankiller
Clankiller.com Forums
Clankiller.com
PlasmaSky.com
satis is offline  
Closed Thread

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 02:29 PM.


Contents ©PowWeb, Inc. ~ vBulletin, Copyright © 2000-2007 Jelsoft Enterprises Limited.