close ad
WARNING PC USERS: Do Not Install the DREAMWEAVER CC 2017 Update »
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

One Button Works Well while the Other One Doesn't

Thread began 10/19/2015 7:11 am by salaroche | Last modified 10/22/2015 3:02 pm by Ray Borduin | 913 views | 12 replies |

salaroche

One Button Works Well while the Other One Doesn't

Hi:

Would anybody know why button No. 1 Sends the right Search parameters to its corresponding Results page while Button No. 2 does NOT?

Button No. 1:

<td><img src="WA_DataAssist/images/Pacifica/GetAttPercent.gif" width="118" height="27" alt="GetAttPercent.gif" onclick="document.getElementById('WADASearchForm').setAttribute('action','-stuattend_ResultsPercent.php');document.getElementById('WADASearchForm').submit();" /></td>

Button No. 2:

<td width="30%"><img src="Images/Buttons/PeriodPerf_Results.gif" width="118" height="27" alt="PeriodPerf_Results.gif" onclick="document.getElementById('WADASearchForm').setAttribute('action','-stuperf_PeriodResultsG1.php');document.getElementById('WADASearchForm').submit();" /></td>

Both lines of code look OK. Their syntax correspond to one another's. Yet, Button No. 1 shows the desired results on the stuattend_ResultsPercent.php page while Button No. 2 does NOT show the desired results on the stuperf_PeriodResultsG1.php.

Any idea why?

Any suggestion would be very appreciated.

Thank you for your attention

Sign in to reply to this post

salaroche

Actually, I just noticed a discrepancy between the two Buttons: The WADA Search sequence that works has an "any form post" trigger while the other one doesn't. The problem now is that both CS6 and CS5 crash whenever I try to change the trigger to "any form post" in the bad page.

I tried changing the code - if ((isset($_GET["Search_x"]) && $_GET["Search_x"] != "")) { - to - if (isset($_GET["S_name"])) { - but it does not work either (the latter seems to work with the good page).

Please note that the Results Page that doesn't work is a modified copy of the one that works.

Just in case, attached please find a copy of the page in question

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

Ray BorduinWebAssist

Do you have a form element on the search page named" "S_name"?

Is the form method ="get"?

Sign in to reply to this post

salaroche

Yes to both.... <form action="-stuperf_DailyResultsG1.php" method="get" name="WADASearchForm" id="WADASearchForm">

The Search page has TWO Search Buttons, one that leads to one Results Page and a second Button leading to second Results page. The second (additional) one is the problem.

Please see attached Search Page

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

Ray BorduinWebAssist

It looks like it would work. What is the url so I can take a look?

Sign in to reply to this post

salaroche

Ray:

Thanks. Unfortunately, right now I don't have those pages uploaded to the Web. I'll upload them later and maybe we can work on this tomorrow. In the meantime, can you tell why the Min(date) and Max(date) functions work well in case No.1 but not in case No.2?

Case No.1:

SELECT oxadmain.name , oxadmain.year , oxadmain.photoID , oxadmain.thumbs , stuattend.ID , stuattend.studid , min(stuattend.date) as fromdate , max(stuattend.date) as todate , stuattend.teacher, stuattend.subject , stuattend.attendance, Count(*) AS RowCount, SUM(if(stuattend.attendance = 'Absent', 1, 0)) AS absents
FROM stuattend INNER JOIN oxadmain ON stuattend.studid=oxadmain.stuid
GROUP BY studid
ORDER BY name ASC

Case No.2:

SELECT oxadmain.name , oxadmain.year , oxadmain.photoID , oxadmain.thumbs , perfgroups1to4.ID , perfgroups1to4.studid , perfgroups1to4.subject , perfgroups1to4.teacher , perfgroups1to4.cw , perfgroups1to4.con , perfgroups1to4.att , perfgroups1to4.attPunct , perfgroups1to4.part , perfgroups1to4.disc , perfgroups1to4.proj , perfgroups1to4.exAct , MIN(perfgroups1to4.date) AS fromDate , MAX(perfgroups1to4.date) AS toDate , SUM(cw) AS cwSum, SUM(con) AS conSum, SUM(att) AS attSum, SUM(attPunct) AS attPunctSum, SUM(part) AS partSum, SUM(disc) AS discSum, SUM(proj) AS projSum, SUM(exAct) AS exActSum, ROUND((AVG(cw)+AVG(con)+AVG(att)+AVG(attPunct)+AVG(part)+AVG(disc)+AVG(proj)+AVG(exAct))/5, 1) AS Avg, cw+con+att+attPunct+part AS ClPerfTot, SUM(disc) AS discTot, cw+con+att+attPunct+part+disc AS Total
FROM perfgroups1to4 INNER JOIN oxadmain ON perfgroups1to4.studid=oxadmain.stuid
GROUP BY studid
ORDER BY name ASC

In case No.2 both Min/Max functions return the date the individual records were entered.

Sign in to reply to this post

Ray BorduinWebAssist

I couldn't say... try simplifying your query and running it directly in phpMyAdmin to debug.

does this query return the results you expect?:

SELECT MIN(perfgroups1to4.date) AS fromDate , MAX(perfgroups1to4.date) AS toDate
FROM perfgroups1to4 INNER JOIN oxadmain ON perfgroups1to4.studid=oxadmain.stuid
GROUP BY studid
ORDER BY name ASC

Sign in to reply to this post

salaroche

I just tested the exact statement you suggested but I don't get the desired results.

Case No.1 above gives 01-10-2015 and 16-10-2015 as Min and Max dates respectively for ALL records. Case No. 2 gives the record-entry date for both the Min and the Max. The simplified Select statement I just tested also does as Case No. 2.

Anyway, I think I'll make a new copy and redesign the page anew and if I encounter the same problems again I'll contact this forum again.

Thank you for your attention.

Sign in to reply to this post

salaroche

Ray:

The stuperf_PeriodResultsG1 page seems to be working well now, except for the Min(date) - Max(date) functions, which refuse to return the desired dates. If you'd like to see for yourself please see the private message below

Sign in to reply to this post

Ray BorduinWebAssist

I'm not sure what max or min date you are trying to retrieve. If you use the SQL statement without the max and min:

SELECT perfgroups1to4.date
FROM perfgroups1to4 INNER JOIN oxadmain ON perfgroups1to4.studid=oxadmain.stuid
GROUP BY studid
ORDER BY name ASC

Whatever the first and last date in that query is will be returned as the max and min date when you add those references. You must be using the wrong query to begin with, because MAX and MIN will do what they are supposed to.

Get the query without the MAX and MIN working first, then you can use MAX and MIN to get the highest and lowest value from a particular field.

If you need help writing the SQL statement, that is something I can do in a premier support ticket.

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...