Rajar Ahmed
asked on
how to hide details for a particular user..?
i logged in by the user, which shows the page......
i created , a page which retrives details from db , the page has several field
such as name, email etc..,like that the page ll be repeated with data from the tables for different id..
Now i need to add two buttons show and hide . which should follows its requirments
i mean , show should be able see for that user , hide , should restricts that name to the user........
i need idea how to do this ..
i created , a page which retrives details from db , the page has several field
such as name, email etc..,like that the page ll be repeated with data from the tables for different id..
Now i need to add two buttons show and hide . which should follows its requirments
i mean , show should be able see for that user , hide , should restricts that name to the user........
i need idea how to do this ..
ASKER
its a admin panel, where i have a fields of name ,email ...now i have to give appropritate prority to that user who will be logged in ,.so, i need two buttons namely show, hide ...if i click show e can c those details when e logged in ..but if i give hide e cant see dat details....
name adfas Show(button) hide(button)
email dsafd@fds.com
name dsaf Show(button) hide(button)
email fdsaf@dfs.com
if show is clicked, he can see .but if hide is clicked he cant see..
how can i do this..???
name adfas Show(button) hide(button)
email dsafd@fds.com
name dsaf Show(button) hide(button)
email fdsaf@dfs.com
if show is clicked, he can see .but if hide is clicked he cant see..
how can i do this..???
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
ders no form , i need button inside this statemt..
Response.Write("<table ><tr><td >Name : </td><td>"&rs(0)&"</td><td ><tr><td align='right'>Email ID : </td><td>"&Rs(1)&"</td></tr><tr><td align='right'></table>")
Like this.....
name adfas Show(button) hide(button)
email dsafd@fds.com
No need of form tag
try this with above javascript function
Response.Write("<table ><tr><td >Name : </td><td>"&rs(0)&"</td><td ><tr><td align='right'>Email ID : </td><td>"&Rs(1)&"</td></t r><tr><td align='right'><input id='Button1' name='btnShow' type='button' value='Hide' onclick='test()'></td></ta ble>")
try this with above javascript function
Response.Write("<table ><tr><td >Name : </td><td>"&rs(0)&"</td><td
ASKER
i found hide button on my page, but there was no action...
it doesnot change to show..
as it did in dat sample which u provided b4..
it doesnot change to show..
as it did in dat sample which u provided b4..
Try like this .
you need to give id to each TR and then pass it from test function like below
<script language="javascript" type="text/javascript" >
function test(trname)
{
if ( document.getElementById("b tnShow").v alue == "Hide" ) {
document.getElementById(tr name).styl e.display = "none"
document.getElementById("b tnShow").v alue = "Show"
}
else
{
document.getElementById(tr name).styl e.display = "block"
document.getElementById("b tnShow").v alue = "Hide"
}
}
</script>
Response.Write("<table ><tr id = 'testtr'><td >Name : </td><td>"&rs(0)&"</td><td ><tr><td align='right'>Email ID : </td><td>"&Rs(1)&"</td></t r><tr><td align='right'><input id='Button1' name='btnShow' type='button' value='Hide' onclick='test('testtr')'>< /td></tabl e>")
you need to give id to each TR and then pass it from test function like below
<script language="javascript" type="text/javascript" >
function test(trname)
{
if ( document.getElementById("b
document.getElementById(tr
document.getElementById("b
}
else
{
document.getElementById(tr
document.getElementById("b
}
}
</script>
Response.Write("<table ><tr id = 'testtr'><td >Name : </td><td>"&rs(0)&"</td><td
Try like this .
you need to give id to each TR and then pass it from test function like below
<script language="javascript" type="text/javascript" >
function test(trname,trname1)
{
if ( document.getElementById("b tnShow").v alue == "Hide" ) {
document.getElementById(tr name).styl e.display = "none"
document.getElementById(tr name1).sty le.display = "none"
document.getElementById("b tnShow").v alue = "Show"
}
else
{
document.getElementById(tr name).styl e.display = "block"
document.getElementById(tr name1).sty le.display = "none"
document.getElementById("b tnShow").v alue = "Hide"
}
}
</script>
Response.Write("<table ><tr id = 'testtr'><td >Name : </td><td>"&rs(0)&"</td><td ><tr id = 'testtr1'><td align='right'>Email ID : </td><td>"&Rs(1)&"</td></t r><tr><td align='right'><input id='Button1' name='btnShow' type='button' value='Hide' onclick='test('testtr','te sttr1')'>< /td></tabl e>")
you need to give id to each TR and then pass it from test function like below
<script language="javascript" type="text/javascript" >
function test(trname,trname1)
{
if ( document.getElementById("b
document.getElementById(tr
document.getElementById(tr
document.getElementById("b
}
else
{
document.getElementById(tr
document.getElementById(tr
document.getElementById("b
}
}
</script>
Response.Write("<table ><tr id = 'testtr'><td >Name : </td><td>"&rs(0)&"</td><td
r u wanting to setup a admin feature where each user is listed and then u can say whether to hide details for each use or not?
ASKER
S ....
S...??
ASKER
i mean .....as u ve said....i want to give appropriate preference to list of users .
if i logged in by a user . i should see a hide / show buton . when i click hide button then the details should be hidden for that particular user . the hide button should change toshow..
if i logged in by a user . i should see a hide / show buton . when i click hide button then the details should be hidden for that particular user . the hide button should change toshow..
what programming language r u using? I c in your post some tags but need to know exactly
cheers
cheers
ASKER
ASP, VB script.
what details r u wanting to hide?
have you tried code in my last comment ? is it working?
Do you have code you can post and comment on that what you want to do? Are you trying to hide information based on which user logs in?
Cheers