Only send certain fields

Is there anyway I can choose which fields i want sent in a posted form?
I currently have the fields user and pass and enc in a login form.
Enc is an encryption of pass.
I only want to send user and enc.

I have thought about just encrypting pass into the pass field when the user attempts to login, but i don't want to do it this way.

Is there any other option i can try?
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Here you go!

<script type="text/javascript">
function encryptit(){
  testform2.enc2.value = //encrypted password
  testform2.user2.value = testform.user.value;
<form name="testform" onSubmit="encryptit();">
Username: <input type="text" name="user"><br>
Password: <input type="password"><br>
<div align="center"><input type="submit">

<form name="testform2" action="somepage" method="post">
 <input type="hidden" name="enc2">
<input type="hidden" name="user2">
You could always add a onSubmit event that will remove the pass field from your form before sending it.

onSubmit="mForm.pass.value = ''; return true;"

how are you encrypting your code?
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

he's not encrypting his code, just the password that the user enters. :)
<script language=javascript>
function submitform(){

<form name=myform1>
<input type=text name=user>
<input type=text name=pass>
<input type=text name=enc>
<input type=button onclick=submitform()>
<form name=myform2 action=page2.asp>
<input type=hidden name=user>
<input type=hidden name=enc>
<input type=button onclick=submitform()>
Depending on JS to do encryption is not a very good idea IMO.

If you need that much security, consider using SSL.

Otherwise, many serverside programming languages and databases provide ways to encrypt/decrypt passwords.

E.g. in PHP/MySQL:

$user = $_POST["username"];
$pass = $_POST["password"];

$q = "SELECT userid FROM users WHERE username='$user' AND password=MD5('$pass')";
if(mysql_num_rows( mysql_query($q) ) == 1)
  $login_status = TRUE;
Disable the fields before submission. I have demonstrated for 'get' but it works for post as well. (google is great for seeing what gets sent)

<form onSubmit="t3.disabled=true;t4.disabled=true; return true" action="">
<input type="text" name="t1" >
<input type="text" name="t2">
<input type="text" name="t3">
<input type="text" name="t4">
<input type="submit"" value="submit">

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Thanks, :-)
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.