Loading ...
Sorry, an error occurred while loading the content.

unable to pass value from javascript to php

Expand Messages
  • Vishwanath B
    hi..I am unable to pass value from javascript to php...my javscript function is in the following way.... function app_fn() { x=confirm( Are you sure ....!!! );
    Message 1 of 1 , May 16, 2007
    • 0 Attachment
      hi..I am unable to pass value from javascript to php...my javscript function is in the following way....
      function app_fn()
      {
      x=confirm("Are you sure ....!!!");
      if(x)
      {
      document.frm.action="filename.php?flag=1";
      document.frm.submit();
      }
      else
      {
      return false;
      }
      }
      and i am trying to print flag value in php in the following manner....
      <? echo $flag; ?> but i am unable to see the value of flag as 1.
      I am calling the function in the following manner....
      <a href="filename.php" onClick="javascript:app_fn()">aa</a>
      and i have another doubt
      I want to know whether this depends on register_globals in php.ini file. I checked with register_globals=off and register_globals=on , when the javascript confirm dialog box is displayed with Ok and cancel buttons, if i click ok the page is getting refreshed and even if i click cancel then also the page is getting refreshed.
      I am using php 5.2.0 ,Windows Xp, Apache 2.0.
      anyone help me plz....its urgent...
      thanks
      vishwanath


      ---------------------------------
      Give spam the boot. Take control with tough spam protection
      in the all-new Yahoo! Mail Beta.

      [Non-text portions of this message have been removed]
    Your message has been successfully submitted and would be delivered to recipients shortly.