471,353 Members | 1,579 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,353 software developers and data experts.

Problem passing the ID to form action page

2
Hi..
I have a problem to pass the ProdID to the next page (ProPreview.asp)
any suggestion on how to make it work? or I need to change anything?
Here are the code..

Expand|Select|Wrap|Line Numbers
  1. <form name="form1" method="post"> 
  2.    <input type="hidden" name="ProdID" value="<%=ProdId%>">
  3.  
  4. <script language="javascript" type="text/javascript">
  5.  
  6.    function gotoPreview()
  7.   {
  8.    document.form1.action = "ProPreview.asp?ProdID=";
  9.    document.form1.submit();
  10.   }
  11. </script>   
  12. .
  13. .
  14. .
  15. <a href=javascript:gotoPreview() onClick="javascript:gotoPreview()"><img src="images/btn_ok.gif" width="75" height="18" border="0"></a>
  16. </form>
  17.  
Thanks for the time.... :)
May 3 '06 #1
2 2046
azrn
2
Expand|Select|Wrap|Line Numbers
  1. <script language="javascript" type="text/javascript">
  2.           function gotoDelete(){
  3.           document.form1.action = "deleteImage.asp";
  4.           document.form1.submit();
  5.           }
  6.  
  7.           function gotoPreview(){
  8.           document.form1.action = "ProPreview.asp?ProdID=" ;
  9.           document.form1.submit();
  10.           }
  11. </script>    
  12.  
i want it to pass the ID
and i will show the id like this ---- > http://.../.../ProPreview.asp?ProdID=111

any idea..
thanks..
May 4 '06 #2
Banfa
9,065 Expert Mod 8TB
Just pass it into the function like so

Expand|Select|Wrap|Line Numbers
  1. <script language="javascript" type="text/javascript">
  2. function gotoPreview(id)
  3. {
  4.     document.form1.action = "ProPreview.asp?ProdID="+id ;
  5.     document.form1.submit();
  6. }
  7. </script> 
  8.  
May 4 '06 #3

Post your reply

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

Similar topics

5 posts views Thread by Paul | last post: by
3 posts views Thread by Pjotr Wedersteers | last post: by
7 posts views Thread by Aaron Prohaska | last post: by
6 posts views Thread by Shaun Fleming | last post: by
5 posts views Thread by Steve | last post: by
1 post views Thread by Bob Bedford | last post: by
reply views Thread by XIAOLAOHU | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.