Page 2 of 2 FirstFirst 12
Results 11 to 15 of 15
  1. #11

    I don't know how capable PHP today in doing that, but base on my understanding on what you want to do is you want to execute a serverside PHP method within javascript which I think possible only by posting your code back to the server. That means you need to post all content to the server or doing the AJAX way which I think best suit for these....

    Sa tinud-anay lang pud wla nako alamag ani PHP kay nakasulay ko 2001 paman guro to.. hehehe.. unya basic pajud.. hahaha...



    Love endures even death...pokloy

  2. #12
    I think your code needs to be done this way.....

    <?php
    $begin = new sampleclass(); //instantiating class

    if($_POST['confirmButton']){
    $begin->save();
    }

    .
    ?>
    <form method="post" id="testFrm" name="testFrm">
    <input type="image" src="https://www.istorya.net/forums/images/confirm.png" name="confirmButton" onClick= test()></input>
    <input type="submit" name="submit" style="display:none"> //define submit
    </form>

    <script type="text/javascript">
    function test()
    {
    var result=confirm('Are you sure to continue Mr.<?php echo $name; ?>');
    if( result == true)
    {
    document.testFrm.submit();
    }
    </script>

    If this is not the way you want this to work, just use ajax..

  3. #13
    gamiti nlng na ug ajax ug gusto ka magcommunicate ang server side script ug ang imong cross browser scipt

  4. #14
    Kani bro, testingi basin makatabang ni nimo.

    <?php
    $begin = new sampleclass(); //instantiating class
    if(isset($_POST['saveConfirmed'])){
    $begin->save();
    }
    ?>
    <form method="post">
    <input type="hidden" id="saveConfirmed" name="saveConfirmed" value="false" />
    <input type="submit" name="submit" onclick="return ask();">
    </form>
    <script type="text/javascript">
    function ask()
    {
    if (confirm('Are you sure to continue?'))
    {
    document.getElementById('saveConfirmed').value = true;
    return true;
    }
    return false;
    }
    </script>

  5. #15
    so far.... sa mga ghatag ninyu nku na code fragments... kang jer2 ra ang sakto... but tnx to all of u anyway.... salamat kaau... problem solved... tnx jer2...

  6.    Advertisement

Page 2 of 2 FirstFirst 12

Similar Threads

 
  1. Replies: 6
    Last Post: 10-12-2012, 11:35 AM
  2. PHP and MSSQL Help
    By bolivar1985 in forum Programming
    Replies: 3
    Last Post: 10-22-2009, 03:42 PM
  3. could anyone help me with php and javascripts
    By isaac42 in forum Programming
    Replies: 6
    Last Post: 05-07-2009, 02:24 PM
  4. Independent contractor info needed---php and mysql
    By BayouPinoy in forum Networking & Internet
    Replies: 0
    Last Post: 03-17-2006, 10:45 PM
  5. HELP: Type and MaxSize of HD (Asus P2B98-XV and Intel CA810)
    By rocknolds in forum Computer Hardware
    Replies: 4
    Last Post: 11-15-2005, 04:04 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
about us
We are the first Cebu Online Media.

iSTORYA.NET is Cebu's Biggest, Southern Philippines' Most Active, and the Philippines' Strongest Online Community!
follow us
#top