Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

hide hidden field from view source

Status
Not open for further replies.

cumap

IS-IT--Management
Jul 9, 2007
268
US
How can I hide value that I assigned to hidden fields from displaying in view source. I tried to make right-click unable, but IE still have menu bar available for user to do view source.

Thanks
 
as far as I know, you can't do that...you can use javascript to create the tags, but they will always be available somehow...

To hide the values altogether, use session variables and retrive them later on, the user can't see these...

Also, if someone turns off their javascript, that disable right click feature becomes useless...



TIP: trying googling the answer before posting, you'll find that more times than not someone else somewhere has had the same request and posted an answer online.
----
I have recently been semi-converted to ensuring all my code (well most of it) works in both javascript and non-javascript enabled browsers
 
How about using frame to display my page. And keep the right-click control still (I know for a fact that viewers need to have js to view this page).

I tried iframe but for some reasons, setting height=100% doesn't let the iframe to open up to the full page. I don't want to set the height the the exact pixels 'cause I cannot control users' monitor. Any way to make this height to work at full size?
 
How about using frame to display my page. And keep the right-click control still (I know for a fact that viewers need to have js to view this page).

I tried iframe but for some reasons, setting height=100% doesn't let the iframe to open up to the full page. I don't want to set the height the the exact pixels 'cause I cannot control users' monitor. Any way to make this height to work at full size?

Sorry, I don't understand what you mean by this - what do you want to use the iframe for?

TIP: trying googling the answer before posting, you'll find that more times than not someone else somewhere has had the same request and posted an answer online.
----
I have recently been semi-converted to ensuring all my code (well most of it) works in both javascript and non-javascript enabled browsers
 
Also, why do you want to hide the information in the hidden field from a view source?

TIP: trying googling the answer before posting, you'll find that more times than not someone else somewhere has had the same request and posted an answer online.
----
I have recently been semi-converted to ensuring all my code (well most of it) works in both javascript and non-javascript enabled browsers
 
In the hidden fields include my allowanced username and password. I allow my viewers to user the info but I don't want them to know the info. Problem is I have to include the info in the fields to submit (I wonder there is another way to include the hidden info w/o assign them to the hidden fields?). Hence, anyone can see the username and password by just using the view source.

I hope I won't lose you after all that lengthy description. :)
 
you are using a server side scripting language, right (i.e. PHP or ASP)

If so, but the username and password into session variables and authenticate against those instead of a form field.

If you are not using a server side language then you're going to open up the username and password.

TIP: trying googling the answer before posting, you'll find that more times than not someone else somewhere has had the same request and posted an answer online.
----
I have recently been semi-converted to ensuring all my code (well most of it) works in both javascript and non-javascript enabled browsers
 
Yes, I'm using ASP, how can I recall asp Session inside js script?
 
you'll need to provide some code and comments on what you are doing, I'll take a look and see if I can figure it out for you...



TIP: trying googling the answer before posting, you'll find that more times than not someone else somewhere has had the same request and posted an answer online.
----
I have recently been semi-converted to ensuring all my code (well most of it) works in both javascript and non-javascript enabled browsers
 
Is the the right way to code?
(in the js script)
Code:
m_ipAddr = <%=Session("ipAddr")%>;
 
Nevermind, vicvirk.

I got it works but the result is pretty much the same to me. the values I'm trying to hide are still shown in the js function anyway. If it's not showing in the hidden fields, it now shown in the js function, I'm getting nowhere.

Thank for your trying! See u in the next problem. :)
 
You don't need to do it in the JSscript unless you are doing your checks within it - you should be doing your username and password checks on the server side using ASP (in you case).

That will hide everything...but you are obviously not really interested in learning how to do it, or are looking for someone else to write your code...so best of luck


TIP: trying googling the answer before posting, you'll find that more times than not someone else somewhere has had the same request and posted an answer online.
----
I have recently been semi-converted to ensuring all my code (well most of it) works in both javascript and non-javascript enabled browsers
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top