Connecting Tech Pros Worldwide Help | Site Map

how to call a from inside js

ddtpmyra's Avatar
Familiar Sight
 
Join Date: Jun 2008
Location: CA
Posts: 222
#1: Oct 9 '09
I have this script and I know im not doing this right. Anybody who can show me how to execute to call a form?

thanks!
Expand|Select|Wrap|Line Numbers
  1. personObj=new Object();
  2. if (document.getElementById('TotalEntity').value > 100 ) 
  3.     {
  4.     personObj.Total=document.getElementById('TotalEntity').value ; 
  5.     alert((personObj.Total));
  6.     }
  7. else
  8.     {
  9.     <form method="post" name="recapform" action="tblevent_entry_recap_handler.php?id=<?php echo $_GET['id'];?> ">
  10.       <td><input type="submit" value="SAVE" /></td></form>
  11.     }    
  12. }    
  13. </script>
Dormilich's Avatar
Moderator
 
Join Date: Aug 2008
Location: Leipzig, Germany
Posts: 3,629
#2: Oct 9 '09

re: how to call a from inside js


what is this code supposed to do?
ddtpmyra's Avatar
Familiar Sight
 
Join Date: Jun 2008
Location: CA
Posts: 222
#3: Oct 9 '09

re: how to call a from inside js


if the conditions falls to ELSE statement i wanted to call this php script

Quote:
action ="tblevent_entry_recap_handler.php?id=<?php echo $_GET['id']";?>
Dormilich's Avatar
Moderator
 
Join Date: Aug 2008
Location: Leipzig, Germany
Posts: 3,629
#4: Oct 10 '09

re: how to call a from inside js


Quote:

Originally Posted by ddtpmyra View Post

if the conditions falls to ELSE statement i wanted to call this php script

and what shall it do in the IF case?
ddtpmyra's Avatar
Familiar Sight
 
Join Date: Jun 2008
Location: CA
Posts: 222
#5: Oct 12 '09

re: how to call a from inside js


inside ELSE statement i wanted to call another php document
acoder's Avatar
Site Moderator
 
Join Date: Nov 2006
Location: UK
Posts: 14,581
#6: Oct 13 '09

re: how to call a from inside js


It seems as though you're trying to submit a form. Use the form submit() method.
ddtpmyra's Avatar
Familiar Sight
 
Join Date: Jun 2008
Location: CA
Posts: 222
#7: Oct 14 '09

re: how to call a from inside js


Quote:

Originally Posted by acoder View Post

It seems as though you're trying to submit a form. Use the form submit() method.

Great! that's the one im trying to do this time :)

Now is there a javascript that will do page refresh everytime I hit my BACK button? or anything i can add on this line below?

Expand|Select|Wrap|Line Numbers
  1.  <form method="post" name="recapform" action="javascript:history.back()"> 
  2.     <td><input type="submit" value="BACK" /></td>
acoder's Avatar
Site Moderator
 
Join Date: Nov 2006
Location: UK
Posts: 14,581
#8: Oct 14 '09

re: how to call a from inside js


Are you sure that's a good idea? It would be highly annoying if you managed it. Why are you trying to prevent the user from going back?
Reply