change inpu type via php

General discussions related to php

Moderators: egami, macek, gesf

Post Reply
User avatar
TomCornar
New php-forum User
New php-forum User
Posts: 25
Joined: Fri Sep 14, 2012 12:06 am

Sun Sep 16, 2012 10:58 pm

Try with js or jquery to sum up the two text box value to another textbox using onclick event.

<script type="text/javascript">
function sum()
{
var value1=document.getElementById('textone').value;
var value2=document.getElementById('texttwo').value;
document.getElementById('textthree').value=(value1*1)+(value2*1);
}
</script>
<form method="post" action="">
<input type="text" id="textone">
<input type="text" id="texttwo">
<input type="text" id="textthree">
<input type="submit" onclick="sum();">
</form>
Hope this Helps.
Regards,
Tom Cornar
Trinay Technology Solutions
http://www.trinay.com

Post Reply
  • Information
  • Who is online

    Users browsing this forum: No registered users and 1 guest