Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

ASP and JavaScript: Function to populate a select box from a database

login.asp:
[code]
<% @Language = "JavaScript" %>
<%
if (Session("LoggedIn") == "YES") {
Response.Redirect("admin.asp"); }

function CreateOptions()
{
// This function needs filling in...
}
%>


Admin Panel - Login




image
Welcome


<% CreateOptions() %>


image


image
" class="btnLogon" id="btnLogon2">
image




[/code]

login.css:
[code]
BODY
{
overflow: hidden;
background-repeat: both;
}

.tblLogon
{
position: absolute;
top: 145px;
left: 300px;
}

.txtUName
{
color: #000000;
position: relative;
top: 2px;
left: -5px;
}

.imgPWord
{
position: absolute;
top: 30px;
left: -2px;
z-index: -1;
}

.strPWord
{
position: relative;
top: 7px;
left: -1px;
width: 153px;
height: 20px;
border-style: solid;
border-width: 1px;
border-color: #FFFFFF;
z-index: 0;
cursor: hand;
}

.imgLogon
{
position: absolute;
top: 32px;
left: 165px;
cursor: hand;
}

.btnLogon
{
visibility: hidden;
position: absolute;
top: 32px;
left: 165px;
width: 24px;
}

.imgHelp
{
position: absolute;
top: 32px;
left: 194px;
cursor: hand;
}

.imgStrikeDown
{
position: absolute;
top: -80px;
left: 290px;
}

.txtWelcome
{
position: absolute;
top: 173px;
left: 50px;
color: #FFFFFF;
font-face: Arial, Helvetica, Times New Roman;
font-size: 18pt;
font-weight: bold;
}

.decULine
{
position: absolute;
top: 60px;
left: -2px;
width: 220px;
height: 1px;
border-style: solid;
border-width: 1px;
border-color: #FFFFFF;
}
[/code]

login.js:
[code]
function BODY_OnLoad()
{
document.getElementById("password").focus();
}
[/code]

I need the function filling in so it can access a database in the same directory called "members.mdb". The users are stored in a table called "Members". Anyone with permissions to login have "ManageLV" set to "3". "ManageLV" is a field in "Members" in "members.mdb". I don't want to use a DSN, I only want the function to fill in options for the select box if the user has "ManageLV" set to 3. I want it to loop through all the users in the table "Members". I also want login.js modified so it can alter the value of the hidden form element "strUName" when the value of the select box changes ( "" ).

I have done something like this before, but it took me too long and I think this is a great project for us all to contribute to. The login page actually takes you to a special "Admin Center" I am building to manage my website, so I will include anyone's contributions in the "Credits". :)

Can anyone help me please?

I put all the files [except the database, for security reasons] in a zip file located at:

http://aaronjones.developer.graphyx.net/extra/admin.zip

Many thanks in advance,

-( Aaron )-

Peace all...

Comments

  • aaronjones3593aaronjones3593 Member Posts: 122
    : login.asp:
    : [code]
    : <% @Language = "JavaScript" %>
    : <%
    : if (Session("LoggedIn") == "YES") {
    : Response.Redirect("admin.asp"); }
    :
    : function CreateOptions()
    : {
    : // This function needs filling in...
    : }
    : %>
    :
    :
    : Admin Panel - Login
    :
    :
    :
    :
    : image
    :
    :
    : : : :
    Welcome
    :
    :
    :
    : : :
    : : :

    :
    : <% CreateOptions() %>
    :
    :

    : image
    :
    :
    : image
    : " class="btnLogon" id="btnLogon2">
    : image
    :

    :
    :
    :
    :
    :
    : [/code]
    :
    : login.css:
    : [code]
    : BODY
    : {
    : overflow: hidden;
    : background-repeat: both;
    : }
    :
    : .tblLogon
    : {
    : position: absolute;
    : top: 145px;
    : left: 300px;
    : }
    :
    : .txtUName
    : {
    : color: #000000;
    : position: relative;
    : top: 2px;
    : left: -5px;
    : }
    :
    : .imgPWord
    : {
    : position: absolute;
    : top: 30px;
    : left: -2px;
    : z-index: -1;
    : }
    :
    : .strPWord
    : {
    : position: relative;
    : top: 7px;
    : left: -1px;
    : width: 153px;
    : height: 20px;
    : border-style: solid;
    : border-width: 1px;
    : border-color: #FFFFFF;
    : z-index: 0;
    : cursor: hand;
    : }
    :
    : .imgLogon
    : {
    : position: absolute;
    : top: 32px;
    : left: 165px;
    : cursor: hand;
    : }
    :
    : .btnLogon
    : {
    : visibility: hidden;
    : position: absolute;
    : top: 32px;
    : left: 165px;
    : width: 24px;
    : }
    :
    : .imgHelp
    : {
    : position: absolute;
    : top: 32px;
    : left: 194px;
    : cursor: hand;
    : }
    :
    : .imgStrikeDown
    : {
    : position: absolute;
    : top: -80px;
    : left: 290px;
    : }
    :
    : .txtWelcome
    : {
    : position: absolute;
    : top: 173px;
    : left: 50px;
    : color: #FFFFFF;
    : font-face: Arial, Helvetica, Times New Roman;
    : font-size: 18pt;
    : font-weight: bold;
    : }
    :
    : .decULine
    : {
    : position: absolute;
    : top: 60px;
    : left: -2px;
    : width: 220px;
    : height: 1px;
    : border-style: solid;
    : border-width: 1px;
    : border-color: #FFFFFF;
    : }
    : [/code]
    :
    : login.js:
    : [code]
    : function BODY_OnLoad()
    : {
    : document.getElementById("password").focus();
    : }
    : [/code]
    :
    : I need the function filling in so it can access a database in the same directory called "members.mdb". The users are stored in a table called "Members". Anyone with permissions to login have "ManageLV" set to "3". "ManageLV" is a field in "Members" in "members.mdb". I don't want to use a DSN, I only want the function to fill in options for the select box if the user has "ManageLV" set to 3. I want it to loop through all the users in the table "Members". I also want login.js modified so it can alter the value of the hidden form element "strUName" when the value of the select box changes ( "" ).
    :
    : I have done something like this before, but it took me too long and I think this is a great project for us all to contribute to. The login page actually takes you to a special "Admin Center" I am building to manage my website, so I will include anyone's contributions in the "Credits". :)
    :
    : Can anyone help me please?
    :
    : I put all the files [except the database, for security reasons] in a zip file located at:
    :
    : http://aaronjones.developer.graphyx.net/extra/admin.zip
    :
    : Many thanks in advance,
    :
    : -( Aaron )-
    :
    : Peace all...
    :

    Has this forum been abandoned ?

    :(

    -( Aaron )-

    Peace all...

  • aaronjones3593aaronjones3593 Member Posts: 122
    Is ANYONE here ?

    I have noticed any new topics aren't getting any replies from anyone aswell...


    Is there something wrong with the website ?

    -( Aaron )-

    "Alcohol aint the answer, but atleast you forget the question"

  • RibbletonRibbleton Member Posts: 152
    : login.asp:
    : [code]
    : <% @Language = "JavaScript" %>
    : <%
    : if (Session("LoggedIn") == "YES") {
    : Response.Redirect("admin.asp"); }
    :
    : function CreateOptions()
    : {
    : // This function needs filling in...
    : }
    : %>
    :
    :
    : Admin Panel - Login
    :
    :
    :
    :
    : image
    :
    :
    : : : :
    Welcome
    :
    :
    :
    : : :
    : : :

    :
    : <% CreateOptions() %>
    :
    :

    : image
    :
    :
    : image
    : " class="btnLogon" id="btnLogon2">
    : image
    :

    :
    :
    :
    :
    :
    : [/code]
    :
    : login.css:
    : [code]
    : BODY
    : {
    : overflow: hidden;
    : background-repeat: both;
    : }
    :
    : .tblLogon
    : {
    : position: absolute;
    : top: 145px;
    : left: 300px;
    : }
    :
    : .txtUName
    : {
    : color: #000000;
    : position: relative;
    : top: 2px;
    : left: -5px;
    : }
    :
    : .imgPWord
    : {
    : position: absolute;
    : top: 30px;
    : left: -2px;
    : z-index: -1;
    : }
    :
    : .strPWord
    : {
    : position: relative;
    : top: 7px;
    : left: -1px;
    : width: 153px;
    : height: 20px;
    : border-style: solid;
    : border-width: 1px;
    : border-color: #FFFFFF;
    : z-index: 0;
    : cursor: hand;
    : }
    :
    : .imgLogon
    : {
    : position: absolute;
    : top: 32px;
    : left: 165px;
    : cursor: hand;
    : }
    :
    : .btnLogon
    : {
    : visibility: hidden;
    : position: absolute;
    : top: 32px;
    : left: 165px;
    : width: 24px;
    : }
    :
    : .imgHelp
    : {
    : position: absolute;
    : top: 32px;
    : left: 194px;
    : cursor: hand;
    : }
    :
    : .imgStrikeDown
    : {
    : position: absolute;
    : top: -80px;
    : left: 290px;
    : }
    :
    : .txtWelcome
    : {
    : position: absolute;
    : top: 173px;
    : left: 50px;
    : color: #FFFFFF;
    : font-face: Arial, Helvetica, Times New Roman;
    : font-size: 18pt;
    : font-weight: bold;
    : }
    :
    : .decULine
    : {
    : position: absolute;
    : top: 60px;
    : left: -2px;
    : width: 220px;
    : height: 1px;
    : border-style: solid;
    : border-width: 1px;
    : border-color: #FFFFFF;
    : }
    : [/code]
    :
    : login.js:
    : [code]
    : function BODY_OnLoad()
    : {
    : document.getElementById("password").focus();
    : }
    : [/code]
    :
    : I need the function filling in so it can access a database in the same directory called "members.mdb". The users are stored in a table called "Members". Anyone with permissions to login have "ManageLV" set to "3". "ManageLV" is a field in "Members" in "members.mdb". I don't want to use a DSN, I only want the function to fill in options for the select box if the user has "ManageLV" set to 3. I want it to loop through all the users in the table "Members". I also want login.js modified so it can alter the value of the hidden form element "strUName" when the value of the select box changes ( "" ).
    :
    : I have done something like this before, but it took me too long and I think this is a great project for us all to contribute to. The login page actually takes you to a special "Admin Center" I am building to manage my website, so I will include anyone's contributions in the "Credits". :)
    :
    : Can anyone help me please?
    :
    : I put all the files [except the database, for security reasons] in a zip file located at:
    :
    : http://aaronjones.developer.graphyx.net/extra/admin.zip
    :
    : Many thanks in advance,
    :
    : -( Aaron )-
    :
    : Peace all...
    :

    Ask smaller questions and don't past 100's of lines of code through. Do we really need to see your stylesheet?

  • aaronjones3593aaronjones3593 Member Posts: 122
    I was only trying to help you all, i do not have the internet at home anymore, i am posting this from school.

    you only need to see my stylesheet if you want to modify / correct it, as i am not very good with css.



    -( Aaron )-

    "Alcohol aint the answer, but atleast you forget the question"

  • RibbletonRibbleton Member Posts: 152
    : I was only trying to help you all, i do not have the internet at home anymore, i am posting this from school.
    :
    : you only need to see my stylesheet if you want to modify / correct it, as i am not very good with css.
    :
    :
    :
    : -( Aaron )-
    :
    : "Alcohol aint the answer, but atleast you forget the question"
    :
    :
    just ask one question at a time instead of posting your full solution and expecting us to work it all out. most people cannot be bothered to read 100 's of lines of code.

Sign In or Register to comment.