close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

One Search Page Redirecting to Two Different Result Pages

Thread began 7/24/2015 8:25 pm by salaroche | Last modified 10/19/2015 9:26 am by Ray Borduin | 3280 views | 37 replies |

salaroche

One Search Page Redirecting to Two Different Result Pages

Hi:

I would like to have a WADASearchForm redirect to TWO different result pages depending on the “Submit” button the user presses. How can that be done?

As it is, it seems that the code: <form action="-stuperf_DailyResults.php" method="get" name="WADASearchForm" id="WADASearchForm"> is sending the search data to the page -stuperf_DailyResults.php.

The task would be to have another submit button that sends the search data to the page: -stuperf_PeriodResults.php.

I have tried using a simple “onclick” statement on the second button and it works, but it only works ONCE. The subsequent searches only repeat the same results given the first time, regardless of whatever new criteria might have been entered on the search page.

How can one single WADAsearchpage be redirected to two different WADAresult pages depending on the button the user presses?

Thank you for your attention.

Sign in to reply to this post

Ray BorduinWebAssist

I think you should be able to add an onclick event to the button that changes the form action:

<input type="button" onclick="document.getElementById['WADASearchForm'].setAttribute('action','-stuperf_DailyResults.php');document.getElementById['WADASearchForm'].submit();" >

Sign in to reply to this post
Did this help? Tips are appreciated...

salaroche

Ray:

I entered the code. It creates the button but when I click it nothing happens. Any suggestions?

Attached please find a copy of the search page.

Attached Files
-stuperf_Search.php
Sign in to reply to this post

Ray BorduinWebAssist

Looks like I had square brackets instead of parenthesis... it should be:

<input type="button" onclick="document.getElementById('WADASearchForm').setAttribute('action','-stuperf_DailyResults.php');document.getElementById('WADASearchForm').submit();" >

Sign in to reply to this post
Did this help? Tips are appreciated...

salaroche

Ray:

It works with the parentheses. Thanks. Now, how do I replace the button I have designed for the button your code created?

Sign in to reply to this post

Ray BorduinWebAssist

If it still doesn't work, please post a URL where I can debug the page live.

Sign in to reply to this post
Did this help? Tips are appreciated...

salaroche

Ray:

It works now. I just need to use the button I have designed instead of the button the code created. How do I do that?

Thank you for your attention.

Sign in to reply to this post

Ray BorduinWebAssist

Just add the onclick="" portion of my button to yours and change it from type="submit" to type="button"

Sign in to reply to this post
Did this help? Tips are appreciated...

salaroche

Ray:

I have to take that enthusiastic statement back. The results page is frozen with the first results it obtained. When I do a second or third search I always get the same initial results.

Sorry to say that some of the other features of the site are already in use by the school, but no performance records have been entered yet, so there is no way to test it live right now.

Just in case, attached you may find a copy of the search page. Thanks.

Actually, the results page is showing ALL the records and doesn't filter according to the selected criteria in the search page...

Attached Files
-stuperf_Search.php
Sign in to reply to this post

Ray BorduinWebAssist

I'd need to see the results page too.

Sign in to reply to this post
Did this help? Tips are appreciated...
loading

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...