Forum Moderators: open

Message Too Old, No Replies

One form, two actions

         

RANunes

9:53 pm on Jun 20, 2007 (gmt 0)

10+ Year Member



Hi,

Thank you in advance for your great help
I have this code and if possible i like to

<form action="http://www.msn.com/search" method="get" onSubmit="search(this)" name="root" target="_self">
<input name="qfront" type="text" style="width: 280px" />
<input type="submit" value="Search" style="height: 26px" name="root" />

How can I use the code above for when I click on the search buton on the master page with one frame, open the search results on _top with two frames.
Top frame with banner and the main frame with the search results of MSN?

Ex:
Master page = one frame. Click on search buton and opens one page x.htm with two frames. Top frame y.htm with banner and main frame z.htm with the search results of MSN

Thank you for your great help

ahmedtheking

6:34 pm on Jun 22, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Use 'onsubmit' (as you have done) and 'onclick' on the button.

RANunes

10:12 pm on Jun 22, 2007 (gmt 0)

10+ Year Member



Thank you for your help but doesent work
I already try in may ways, but no luck

<input type="submit" value="Search" onclick="javascript:parent.topframename.location.href="frame.htm" style="height: 26px" name="root" /></td>

This is correct?

ahmedtheking

8:27 am on Jun 23, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Ah ok, try adding 'return false;' in to the onSubmit. This stops the submission of the form and then allows you to execute your JS. Now as for the Form's vars, you can submit them via JS (because you're using GET).

[edited by: jatar_k at 1:56 pm (utc) on June 23, 2007]
[edit reason] no urls thanks [/edit]

RANunes

9:53 am on Jun 23, 2007 (gmt 0)

10+ Year Member



Thank you for your great help but...

I use 'return false;' and now I dont have any results and I can get no frame.

I have a web page with one frame. When i clich on search i like to have a page with 2 frames. On top a banner and on main, the search results.

Past one week to search make experiences no way I dont know how to make that.

Please help me

DrDoc

3:03 pm on Jun 23, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



If you have any server side scripting knowledge at all, set up a PHP/ASP script, submit your form to it, have it create the frameset. It works exactly the way you want, requiring no JavaScript, which means it will work for users who have JavaScript disabled as well. :)

RANunes

3:34 pm on Jun 23, 2007 (gmt 0)

10+ Year Member



Is to much for me.

Can you tell me where I can find a site to convert my litle script to php and run on serverside?

Thank you for your great help