Forms

This is a discussion on Forms within the alt.comp.lang.php forums, part of the PHP Programming Forums category; I;m having probs with this script. when i click update form the values from the text boxs that javascript ...


Go Back   Usenet Forums > PHP Programming Forums > alt.comp.lang.php

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 10-23-2006
Kathryn Gill
 
Posts: n/a
Default Forms

I;m having probs with this script. when i
click update form the values from the text boxs that javascript updates
won't be saved in the data base and i think it's a php based problem.
Can any1 help?
Thanks
Kat

<script type="text/javascript">
function ptotal(x,z,r,h,g)
{
var y=document.getElementById(x).value
var d=document.getElementById(z).value
var f=document.getElementById(r).value
document.getElementById(h).value=parseFloat(y*3)+p arseFloat(d)
document.getElementById(g).value=parseFloat(y)+par seFloat(d)+parseFloat(f)
}

function gdtotal(x,z,h)
{
var s=document.getElementById(x).value
var k=document.getElementById(z).value

document.getElementById(h).value=parseFloat(s)-parseFloat(k)
}

</script>
*some code"

<form id="form1" action="admin.php?page=leagueedit" method="post"
enctype="multipart/form-data">

<input type="hidden" name="t_day" value="<?php echo date("d");?>">
<input type="hidden" name="t_month" value="<?php echo date("m");?>">
<input type="hidden" name="t_year" value="<?php echo date("Y");?>">

<?php
while ($row = mysql_fetch_array($numresults)) {
?>
<tr>
<td width="150"><? echo $row{'TEAM'};?></td>

<td><input type="text" size="3" id="<? echo "t_played" . $row{'id'};?>"
name="<? echo "t_played" . $row{'id'};?>" value="<? echo $row{'PLAYED'};?>"
disabled></td>
<td><input type="text" size="3" id="<? echo "t_won" . $row{'id'};?>"
name="<? echo "t_won" . $row{'id'};?>" value="<? echo $row{'WIN'};?>"
onchange="ptotal(this.id,'<? echo "t_draw" . $row{'id'};?>','<? echo
"t_lost" . $row{'id'};?>','<? echo "t_pts" . $row{'id'};?>','<? echo
"t_played" . $row{'id'};?>')"></td>
<td><input type="text" size="3" id="<? echo "t_draw" . $row{'id'};?>"
name="<? echo "t_draw" . $row{'id'};?>" value="<? echo $row{'DRAW'};?>"
onchange="ptotal('<? echo "t_won" . $row{'id'};?>',this.id,'<? echo "t_lost"
.. $row{'id'};?>','<? echo "t_pts" . $row{'id'};?>','<? echo "t_played" .
$row{'id'};?>')"></td>
<td><input type="text" size="3" id="<? echo "t_lost" . $row{'id'};?>"
name="<? echo "t_lost" . $row{'id'};?>" value="<? echo $row{'LOST'};?>"
onchange="ptotal('<? echo "t_won" . $row{'id'};?>','<? echo "t_draw" .
$row{'id'};?>',this.id,'<? echo "t_pts" . $row{'id'};?>','<? echo "t_played"
.. $row{'id'};?>')"></td>
<td><input type="text" size="3" id="<? echo "t_for" . $row{'id'};?>"
name="<? echo "t_for" . $row{'id'};?>" value="<? echo $row{'GFOR'};?>"
onchange="gdtotal(this.id,'<? echo "t_against" . $row{'id'};?>','<? echo
"t_gd" . $row{'id'};?>')"></td>
<td><input type="text" size="3" id="<? echo "t_against" . $row{'id'};?>"
name="<? echo "t_against" . $row{'id'};?>" value="<? echo
$row{'AGAINST'};?>" onchange="gdtotal('<? echo "t_for" .
$row{'id'};?>',this.id,'<? echo "t_gd" . $row{'id'};?>')"></td>

<td><input type="text" size="3" id="<? echo "t_gd" . $row{'id'};?>"
type="text" name="<? echo "t_gd" . $row{'id'};?>" value="<? echo
$row{'GD'};?>" disabled></td>
<td><input type="text" size="3" id="<? echo "t_pts" . $row{'id'};?>"
type="text" name="<? echo "t_pts" . $row{'id'};?>" disabled value="<? echo
$row{'PTS'};?>"></td>
</tr>
<? }?>
</table>

<input type="submit" name="submit" value="Update Table">
</form>




Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 02:02 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0