Help with Javascript, forms, frames

M

MaryLou

Hi,

Am new to Javascript. Having fun but need help please. I have a left nav
page that's used in 1/ a frameset for a few pages that pull in external
content in the "main" frame; and 2/ as an FrontPage include in all the other
pages. This left nav page has a form (single text field) which does a search
on an external website and returns a result. Am trying to get it to return
the result into the frameset using Javascript to specify the "main" page for
that content. eg:

<td width="114"><form
action="frameset.htm?http://www.raywhite.com/cgi-bin/rsearch/" target=_blank
method=get name=id>
<input type="text" name="id" size="14" style="border-style: solid;
border-width: 1px; padding-left: 1px; padding-right: 1px; padding-top: 1px;
padding-bottom: 1px">
<input type=hidden name=a value=o>
<input type=hidden name=cu value=fn-raywhite>
<input type=hidden name=ag value=XRWMOW>
<input type=hidden name=header value=off>
</td> <td align="right" valign="bottom"> <a href="javascript:;"
onClick="document.id.submit(); return false;"><img src="images/button_go.gif"
alt="Search" width="25" height="17" border="0" align="baseline"></a></td>

.... but as soon as I add the "frameset.htm?" at the beginning of the <form
action section, it stops working .. it doesn't return the external content
into the 'main' frame. That same method (frameset.htm?http:urlhere), used as
text links in the left nav page works fine .. those links redirect to the
frameset with the correct external page in the main frame. Does anyone know
how to fix this so that this same thing can happen when it comes from a form?

Thanks
.... MaryLou
 
S

Stefan B Rusynko

Form actions and link parameters are not the same

When you use a parameter on a link (?somepageurl.htm after a frameset.htm) the receiving page is parsing and processing the
parameter (probably w/ another JavaScript in frameset.htm)

When you use a parameter as an action on a form (?somepageurl.htm after a frameset.htm in the action=) the form is sending results
to a receiving page (frameset.htm) and expecting the receiving page (frameset.htm), not the Perl script (at
http://www.raywhite.com/cgi-bin/rsearch) to process the parameter and form results

To pass form fields to other pages in frame see
http://irt.org/script/form.htm#10.3

PS
plus your onclick event does not allow any form field results (other than document.id.) to be processed because it has a return
false; in it in:
<a href="JavaScript:;"onClick="document.id.submit(); return false;">



| Hi,
|
| Am new to Javascript. Having fun but need help please. I have a left nav
| page that's used in 1/ a frameset for a few pages that pull in external
| content in the "main" frame; and 2/ as an FrontPage include in all the other
| pages. This left nav page has a form (single text field) which does a search
| on an external website and returns a result. Am trying to get it to return
| the result into the frameset using Javascript to specify the "main" page for
| that content. eg:
|
| <td width="114"><form
| action="frameset.htm?http://www.raywhite.com/cgi-bin/rsearch/" target=_blank
| method=get name=id>
| <input type="text" name="id" size="14" style="border-style: solid;
| border-width: 1px; padding-left: 1px; padding-right: 1px; padding-top: 1px;
| padding-bottom: 1px">
| <input type=hidden name=a value=o>
| <input type=hidden name=cu value=fn-raywhite>
| <input type=hidden name=ag value=XRWMOW>
| <input type=hidden name=header value=off>
| </td> <td align="right" valign="bottom"> <a href="javascript:;"
| onClick="document.id.submit(); return false;"><img src="images/button_go.gif"
| alt="Search" width="25" height="17" border="0" align="baseline"></a></td>
|
| ... but as soon as I add the "frameset.htm?" at the beginning of the <form
| action section, it stops working .. it doesn't return the external content
| into the 'main' frame. That same method (frameset.htm?http:urlhere), used as
| text links in the left nav page works fine .. those links redirect to the
| frameset with the correct external page in the main frame. Does anyone know
| how to fix this so that this same thing can happen when it comes from a form?
|
| Thanks
| ... MaryLou
 
M

MaryLou

Hi Stefan,

Thanks for the tips. I checked out the page you posted, and read all of the
articles that looked relevant, but I didn't see anything directly related to
my problem and nothing that looked like I could adapt it. Because I'm a
novice I guess I'm looking for a direct match to my particular problem ...
still hoping for that.

Any other suggestions please?

.... MaryLou
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top