Help Desk Software & Beyond
February 04, 2012, 03:05:14 AM *
Welcome, Guest. Please login or register.
To post messages you need to register. We apologize for inconvenience, but this is to prevent spam.
Registration is instant (no email verification) and we do not ask for any personal information.

Login with username, password and session length
News: Welcome to Help Desk Software forum!
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: [MOD] Auto populate hidden fields based on another field in your HTML templates  (Read 1386 times)
arvin
Sr. Member
****

Karma: 9
Posts: 400


Yeah thats right !


View Profile
« on: August 06, 2010, 03:11:52 PM »

Hello,

Just in case someone is trying to do this with their HTML templates ..... I found this code I thought i would share  Grin

Code:
<script>
function copyValues() {
document.form1.hiddenImage1.value = document.form1.Image1.value;
document.form1.hiddenImage2.value = document.form1.Image2.value;
}
</script>


<form id="form1" name="form1" method="post" action="">
<label>hidden</label>
<input type="text" name="hiddenimage1" id="hiddenImage1" />
<input type="text" name="hiddenimage2" id="hiddenImage2" />
  <label>Visible</label>
  <input type="text" name="Image1" id="Image1"  />
<input type="text" name="Image2" id="Image2" />

<button name="submit" value="submit" type="button" onClick="copyValues();">Submit</button> 
</form>

****Note****

I have attached it to onClick but you could use it with onSubmit.
Also try and avoid using spaces in "id's" - saves huge headaches later on! Grin
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1 RC3 | SMF © 2001-2006, Lewis Media Valid XHTML 1.0! Valid CSS!
Page created in 0.017 seconds with 18 queries.