Go Back  DVD Talk Forum > General Discussions > Tech Talk
Reload this Page >

Another HTML/ASP question.

Tech Talk Discuss PC Hardware, Software, Internet and Other Technology

Another HTML/ASP question.

Old 11-13-01, 12:06 PM
  #1  
DVD Talk Special Edition
Thread Starter
 
Join Date: Feb 2001
Location: Brampton, Ontario, Canada
Posts: 1,611
Likes: 0
Received 0 Likes on 0 Posts
Another HTML/ASP question.

I have a form that calls a Crystal Report. It collects the data and opens the crystal report file like so:

form name=arrestreport method="POST" action="ArrestReport.rpt"

The problem is that I dont want to always open ArrestReport.rpt. I have a drop down box called "groupby" and if this is a certain value I want to open "ArrestReportSorted.rpt"

I cant seem to be able to do this. Any of you guys know how?
Old 11-13-01, 12:57 PM
  #2  
DVD Talk Gold Edition
 
Join Date: Dec 1999
Posts: 2,708
Likes: 0
Received 0 Likes on 0 Posts
Use a little JavaScript.

Put this as the form tag...

<form name=arrestreport method="POST" action="ArrestReport.rpt" onSubmit="return checkIt()">

Then in the <head> put this

<SCRIPT LANGUAGE="JavaScript">
function checkIt() {
var list = document.arrestreport.groupby.selectedIndex
if (document.arrestreport.groupby.options[list].value == "PlaceYourSpecificValueHere") {
return (true);
} else {
return (false);
}
}
-->
</SCRIPT>

Last edited by Lampei; 11-13-01 at 01:01 PM.
Old 11-13-01, 01:18 PM
  #3  
DVD Talk Special Edition
Thread Starter
 
Join Date: Feb 2001
Location: Brampton, Ontario, Canada
Posts: 1,611
Likes: 0
Received 0 Likes on 0 Posts
Thanks for helping Lampei!!!

I did what you said, and now if the dropdown box =POC then the report opens (arrestreport.rpt).

But if its the other (the value is Highest)it wont open the (arrestreportsorted.rpt)

Thanks again.
Old 11-13-01, 03:26 PM
  #4  
DVD Talk Gold Edition
 
Join Date: Dec 1999
Posts: 2,708
Likes: 0
Received 0 Likes on 0 Posts
Glad to help.
Old 11-13-01, 03:44 PM
  #5  
DVD Talk Special Edition
Thread Starter
 
Join Date: Feb 2001
Location: Brampton, Ontario, Canada
Posts: 1,611
Likes: 0
Received 0 Likes on 0 Posts
But it's still not working!!!!!!!


I need to have it open the other page (arrestreportsorted.rpt) if the condition is false!
Old 11-13-01, 07:05 PM
  #6  
DVD Talk Gold Edition
 
Join Date: Dec 1999
Posts: 2,708
Likes: 0
Received 0 Likes on 0 Posts
Sorry, misunderstood. Very simple solution...just switch

if (document.arrestreport.groupby.options[list].value == "PlaceYourSpecificValueHere") {
return (true);
} else {
return (false);

with

if (document.arrestreport.groupby.options[list].value == "PlaceYourSpecificValueHere") {
return (false);
} else {
return (true);

The return (true) in the first case just tells the form to submit if your specific value in the drop down is submitted. The second case (with the values switched) tells the form NOT to submit if that value is in the dropdown, but WILL submit if ANY other value is there.

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Thread Tools
Search this Thread

Archive - Advertising - Cookie Policy - Privacy Statement - Terms of Service - Do Not Sell My Personal Information -

Copyright 2021 MH Sub I, LLC dba Internet Brands. All rights reserved. Use of this site indicates your consent to the Terms of Use.