close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

DataAssist Search Page Multi Submit Buttons

Thread began 8/17/2009 10:23 am by Intrigue25 | Last modified 8/21/2009 3:59 pm by Jason Byrnes | 3541 views | 10 replies |

Intrigue25

DataAssist Search Page Multi Submit Buttons

Hello,

I have a DataAssist Search page i created with a dropdown box and I am viewing the results on the same page. I needed to modify the code to have 2 buttons on the form. 1 to display the results ( on the same page as the dropdown search box) the other to send the varaible to a export page that allows my client to export the selected database into a excel spreadsheet. I have everything working fine except the search page is not refreshing the results after i choose from the dropdown box.

I am using the Javascript below to activate the two buttons.

<script language="Javascript">

function OnButton1()
{
document.bListSearch.action = "search.php"
document.bListSearch.submit(); // Submit the page
return true;
}
function OnButton2()
{
document.bListSearch.action = "export.php"
document.bListSearch.submit(); // Submit the page
return true;
}
</script>

Here is the form....

<form name="bListSearch" method="post">
<table cellpadding="2" cellspacing="0" border="0">
<tr>
<td align="right"><label for="birthdayMonth">Keywords</label></td>
<td><select name="birthdayMonth">
<option>All</option>
<option value="June">June</option>
<option value="August">August</option>
</select></td>
</tr>
<tr>
<td align="center" colspan="2">
<INPUT type="button" value="Submit" name=button1 onclick="return OnButton1();">
<INPUT type="button" value="Export" name=button2 onclick="return OnButton2();">
</td>
</tr>
</table>

Any help would be appreciated

Sign in to reply to this post

Jason ByrnesWebAssist

What is the trigger for Database search on either the export or search pages?

Try clicking the lightning bolt next to trigger. In the Dynamic Data Bindings, expand the form and select the birthdayMonth select list as the trigger.

Sign in to reply to this post

Intrigue25

That worked! But...

Thanks Ray

One more question. How do i get the dropdown menu to display all the recordeds?
My Dropdown reads.

Value Label
All
June June
July July
August August etc...

I would like all to show all the record in the table when selected.

Thanks in Advance

Sign in to reply to this post

Jason ByrnesWebAssist

The value for the all option must be a blank string:
[html]<option value="">All</option>[html]

Sign in to reply to this post

Intrigue25

Display All records .. Not Working

Jason

Thanks Again for all your help. But i had that in my dropdown box. Here is the code
In my DataAssist Search Wizard I am doing a Exact Match. Is that problem?
If so what other search element should i do? I have attached a screen shot of the dataAssist wizard and below is the Dropdown list code i have in place

<select name="birthdayMonth">
<option value="" selected>All</option>
<option value="January">January</option>
<option value="February">February</option>
<option value="March">March</option>
<option value="April">April</option>
<option value="May">May</option>
<option value="June">June</option>
<option value="July">July</option>
<option value="August">August</option>
<option value="September">September</option>
<option value="October">October</option>
<option value="November">November</option>
<option value="December">December</option>
</select>

Thanks

Sign in to reply to this post

Jason ByrnesWebAssist

That should work, can you post a link to your page?

Sign in to reply to this post

Intrigue25

File

Jason,

Sorry i can not post a link to the page because Its a live site and that page is in a Secure Area, but i have attached the page to this Thread so you can look it over.
Please let me know if you need anything else.
(P.S. I have no problem doing this off the forum)

thanks
Chad

Attached Files
Search Page.zip
Sign in to reply to this post

Intrigue25

Sorry - Wrong File

Jason,

I attached the wrong file to the last post. Please disreguard that file and use the one attached to this post.

Attached Files
Search Page.zip
Sign in to reply to this post

Jason ByrnesWebAssist

The problem is that the search is triggered on the birthdayMonth form element being set and not equling a blank string.

If it equals a blank string, it will end up using the last search you preformed.



try changing:
if ((((isset($_POST["birthdayMonth"]))?$_POST["birthdayMonth"]:"") != "")) {

to:
if (isset($_POST["birthdayMonth"])) {

Sign in to reply to this post

Intrigue25

Didn't seem to Fix

Jason,

I tried changing that line of code and i am getting the same results.

Sign in to reply to this post
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...