I am very new to HTML, ASP, and Javascript, so please be patient with me. I am wondering the best way to do something. Let me see if I can adequately explain.
I have a existing web page that using ASP is generating a table for me. It's querying a database and printing out the information in table format. The data is actually showing logs of emails that were sent. This table mostly just displays information which need no further explanation, such as date, subject, etc... There is one column which does need further explanation however. It's the recipient list column. We make use of "groups". So what is CURRENTLY being displayed in the table is something generic like "MarketingGroup". The information as to who is actually in the "MarktetingGroup" is contained in a totally different database. I'd like the user to be able to click on the words MarketingGroup contained in the table, either as a link or a button, whatever you think is easiest, and have it, at that time, go out and query this other database and show the user the contents. I don't want it to look up every group ahead of time as this data table might have hundreds of rows in it and I don't necessarily NEED explanation of the contents of each group. So I would only want it to query the other database and find the group contents when the user clicks on it.
What I've done is create two <div>'s on my page. One with the main results table, and another one that I'd ideally like to use to display the contents of the group that was just clicked on. So right now, I have the group column set to be a link. So it would generate (via my ASP) something like this:
And my javascript simply hides one div and displays the other:
<script type="text/javascript">
So that's all well and good. It does hide my original div that has my main table on it, and it shows the other div. But I'm struggling with how to do the rest. What is the best way for me to do this? I need to be able to click on the link, or button that's generated via the ASP, and have it at that time look up the information from the other database. So it seems like I need to get the html for the MarketingGroup for example call a sub. That sub would query the database and populate the AlertGroupResultsDiv <div>. Then I need it to hide the one div and show the other (like my javascript does above).
Any idea how I can do this? Do I want the column for the group (like MarketingGroup) to be a button? How can I get the button to call a Sub, and pass along the group name it's for? Sorry if this is confusing. I'm having a hard time explaining it, let alone coding it...
I have a existing web page that using ASP is generating a table for me. It's querying a database and printing out the information in table format. The data is actually showing logs of emails that were sent. This table mostly just displays information which need no further explanation, such as date, subject, etc... There is one column which does need further explanation however. It's the recipient list column. We make use of "groups". So what is CURRENTLY being displayed in the table is something generic like "MarketingGroup". The information as to who is actually in the "MarktetingGroup" is contained in a totally different database. I'd like the user to be able to click on the words MarketingGroup contained in the table, either as a link or a button, whatever you think is easiest, and have it, at that time, go out and query this other database and show the user the contents. I don't want it to look up every group ahead of time as this data table might have hundreds of rows in it and I don't necessarily NEED explanation of the contents of each group. So I would only want it to query the other database and find the group contents when the user clicks on it.
What I've done is create two <div>'s on my page. One with the main results table, and another one that I'd ideally like to use to display the contents of the group that was just clicked on. So right now, I have the group column set to be a link. So it would generate (via my ASP) something like this:
HTML:
<td class='cell'><A id = 'displayText' HREF = '#' onclick='return hideDiv();'>MarketinGroup</A></td>
<script type="text/javascript">
JavaScript:
function hideDiv(str) {
document.getElementById("ResultsDiv").style.visibility = "hidden";
document.getElementById("AlertGroupResultsDiv").style.visibility = "visible";
}
</script>
Any idea how I can do this? Do I want the column for the group (like MarketingGroup) to be a button? How can I get the button to call a Sub, and pass along the group name it's for? Sorry if this is confusing. I'm having a hard time explaining it, let alone coding it...