RE: Radio buttons from database (Full Version)

All Forums >> [Web Development] >> General Web Development



Message


rdouglass -> RE: Radio buttons from database (2/13/2007 10:21:24)

quote:

The radio buttons don't seem to be picking up the defaults.


Maybe I'm starting to get a clearer picture. Let me see if I can get this right.

1. The link passes the AliasID. Then you read from the DB to get the default Primary_Contact? (I think I missed that part from the beginning).

2. Then the radio is selected based on that returned default value?

I really don't want to address the rest just yet. Let's get this one down first. All the stuff I gave you was assuming the first link had the ID of the Primary_Contact (AliasID) already there.

(Sometimes these can be difficult questions to answer 'cause I don't really know the whole question.)

So can you confirm these 2 steps or do I still have the wrong idea?

EDIT. One more quick thought: Can you get the PeopleID into the first link? How is that being generated? If it's from the DB, you should be able to add that default PeopleID on that first link and we can make things work as we have them setup now. That any good?




jvcnacho -> RE: Radio buttons from database (2/13/2007 11:57:05)

Correct on both. The user sees the name of the organization, clicks the link and that passes the AliasID (AliasID refers to Organization in tblPeople). I don't know how to get the PeopleID into the link because the query that draws the AliasID uses a distinct on Alias. When I do:
"SELECT Distinct Alias, AliasID, PeopleID, Primary_Contact FROM qryPrimaryContact ORDER BY Alias ASC"
an organizations name appears for ever person associated with it.
Any thoughts?






rdouglass -> RE: Radio buttons from database (2/13/2007 12:45:00)

Well, if these 2 conditions are true:

1. That query builds the links on that first page.

2. PeopleID is the ID of the Primary_Contact

you should be able to add the PeopleID to the original link (in a querystring) just like you add the other querystring parameters. Once you have that added, we should be able to use the code that Request.querystring("PeopleID").

Does that make sense?

In order to get the radio selected properly, we *must* pass some identifyer to the IF...THEN code. We have to get past that before any of the array stuff means anything.

Can you do that? That is if those 2 conditions are true, can you add the PeopleID to the querystring?




jvcnacho -> RE: Radio buttons from database (2/13/2007 13:46:57)

I guess where I am stuck is that there's a one to many relationship between organizations and people. I when I pull the list of organizations without a distinct statement I have every organization in the list for every person associated with it. I could pull the name of the organization and its primary contact, but how would I give the user a choice of other people in that organization to make primary contact. Maybe what I'm attempting is too complex for my level of experience? [:o]




rdouglass -> RE: Radio buttons from database (2/13/2007 14:05:24)

quote:

how would I give the user a choice of other people in that organization to make primary contact.


I thought we were trying to pre-select the primary_contact? Am I wrong there as well?

I am talking about adding the PeopleID to the querystring on student.neric.org/test5 where it lists the organizations. Isn't that page displaying the query you're talking about?

What I'm trying to do is to get the default primary-contact (which I'm assuming is the PeopleID from that query) passed to the page that lists the radio buttons. 2 separate pages and 2 separate queries.

Does that make sense so far? I really am trying not to confuse the issue but somehow either I'm not understanding the picture or I am not getting my point across.

So we pass the 'default' to the second page which lists the radios, correct?

Then we pre-select the default, correct?

We can pre-select the default and still list all the folks you want to.

Please let me know if I am wrong on any of these....




jvcnacho -> RE: Radio buttons from database (2/13/2007 14:46:37)

This is how I saw it:

List of organizations

Org A
Org B
Org C

in frame on the left. The user clicks on Org A which gives them the People associated with Org A in the frame on the right.

The frame on the right would have a list:

( )PersonAa
(*)PersonAb
( )PersonAc

(Save Button)

Where the PersonAb is the primary contact--having a radio button checked. If personAc were to become the primary contact, then the user would select that radio button and click save.

This link in Org A would have AliasID, the id for the organization, so that the list of people associated with the that organization could be populated on the right. PeopleIDs belong to the set of all people who are assoicated with given organization. The primary contact is stored in the the tblPeople in a separate field in tblPeople as a Y/N value. The default primary contact could be any one of the people ID queried when the user selects an organization.

I am stuck now where I can select the current primary contact for a given org, but I don't know how to generate the list of the other people that it could be for the user to choose from.


quote:

ORIGINAL: rdouglass

quote:

how would I give the user a choice of other people in that organization to make primary contact.


I thought we were trying to pre-select the primary_contact? I didn't think we would pre-select, maybe that's a better way to do it. If we preselect how could I get the list of alternatives?

I am talking about adding the PeopleID to the querystring on student.neric.org/test5 where it lists the organizations. Isn't that page displaying the query you're talking about? Yes however, PeopleID is only the possible Primary Contacts, PeopleID + Primary Contact="Y" makes a Primary Contact in the table

Does that make sense so far? I put in an example to let you see how I'm approaching it, I'm not sure if I follow how you are.


Does my example help you where I was going/coming from?




rdouglass -> RE: Radio buttons from database (2/13/2007 15:06:21)

Yes it does help but your example page is now showing dropdowns instead of radios.

OK. Talking *specifically* about the DISTINCT query that you build the list of links from, does the primary_contact and the PeopleID correspond to the same person?




jvcnacho -> RE: Radio buttons from database (2/13/2007 15:19:44)

I have moved the example page:
So now you'll want to log in as before, then go to People and then "Testing Radio Buttons" on the right.
The PeopleID's sitting as parameters on those links are the PeopleIDs of the those organizations primary contacts. I think I'm starting to follow you now....




rdouglass -> RE: Radio buttons from database (2/13/2007 15:42:56)

quote:

I think I'm starting to follow you now....


Great. Then you can see why we want the PeopleID in the first link? That *should* fix it up for the radios being pre-selected.

EDIT: Hopefully you're working on it since I got a DB error when I tried that new page. If we're passing the PeopleID, we need to go back to the script that uses the IF..THEN for the PeopleID parameter.




jvcnacho -> RE: Radio buttons from database (2/13/2007 16:14:09)

I need to sign off for the day and get ready for this storm they're reporting. Thanks for your help, and I will be in touch with the edits.




Page: <<   < prev  1 [2]

Valid CSS!




Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI
0.046875