3 Replies - 1366 Views - Last Post: 21 May 2009 - 12:32 AM

#1 ucan_aps  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 31
  • Joined: 26-December 08

view source showing jsp values

Posted 19 May 2009 - 12:12 AM

Hi all..
I hope this topic should go here..

<input type="text" name="username" value=<%=rs.getString("UserName")%> >


im using above code to let the users to update their details when they want to do..
bt here view source shows the original username like below..


<input type="text" name="username" value=abc >
..


can anyone help me to get rid of this..? or any other suggestions..?

Is This A Good Question/Topic? 0
  • +

Replies To: view source showing jsp values

#2 gregwhitworth  Icon User is offline

  • Tired.
  • member icon

Reputation: 219
  • View blog
  • Posts: 1,605
  • Joined: 20-January 09

Re: view source showing jsp values

Posted 19 May 2009 - 07:50 AM

Can you give us the code that the form is using to update the username, because the only rashional way I can think of is shoving this value into a hidden input field, and then telling the script that (this is in PHP - don't know JSP but the theory is there):

if (isset($_POST['username'])) {
		 $username = $_POST['username'];}
else {
	  $username = $_POST['oldUsername'];}



HTML

<input type="hidden" name="oldUsername" value=<%=rs.getString("UserName")%>  />
<input type="text" name="username" value="Enter new username if you wish to change it" />



Sorry I can't just lay out the JSP for you, but just maybe someone here can give you the details, or maybe you can even figure something out.

Basically what the script will do is say, If the user filled in the new username field then set that as the Username, if they didn't then use the value that was sent in the hidden field.

Good Luck,
Greg
Was This Post Helpful? 0
  • +
  • -

#3 PsychoCoder  Icon User is offline

  • Google.Sucks.Init(true);
  • member icon

Reputation: 1642
  • View blog
  • Posts: 19,853
  • Joined: 26-July 07

Re: view source showing jsp values

Posted 19 May 2009 - 08:03 AM

I'm not 100% sure I understand your question (but I think I do). When printing values to a HTML element like that you cannot stop them from viewing their values with View Source
Was This Post Helpful? 0
  • +
  • -

#4 ucan_aps  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 31
  • Joined: 26-December 08

Re: view source showing jsp values

Posted 21 May 2009 - 12:32 AM

Thanks for everone's reply..
as PsychoCoder said When printing values to a HTML element as i did ,we cannot stop them from viewing their values with View Source.. so i just changed my design..

This post has been edited by ucan_aps: 21 May 2009 - 12:33 AM

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1