By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,608 Members | 1,940 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,608 IT Pros & Developers. It's quick & easy.

how to call a from inside js

ddtpmyra
100+
P: 333
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>
Oct 9 '09 #1
Share this Question
Share on Google+
7 Replies


Dormilich
Expert Mod 5K+
P: 8,639
what is this code supposed to do?
Oct 9 '09 #2

ddtpmyra
100+
P: 333
if the conditions falls to ELSE statement i wanted to call this php script

action ="tblevent_entry_recap_handler.php?id=<?php echo $_GET['id']";?>
Oct 9 '09 #3

Dormilich
Expert Mod 5K+
P: 8,639
@ddtpmyra
and what shall it do in the IF case?
Oct 10 '09 #4

ddtpmyra
100+
P: 333
inside ELSE statement i wanted to call another php document
Oct 12 '09 #5

acoder
Expert Mod 15k+
P: 16,027
It seems as though you're trying to submit a form. Use the form submit() method.
Oct 13 '09 #6

ddtpmyra
100+
P: 333
@acoder
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>
Oct 13 '09 #7

acoder
Expert Mod 15k+
P: 16,027
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?
Oct 14 '09 #8

Post your reply

Sign in to post your reply or Sign up for a free account.