Results 1 to 10 of 10
  1. #1

    Default incrementing value using textbox php/javascript


    mga boss naa moi idea unsaon nehh, pila nko ka adlaw try and error wla lang ghapon,

    in,aneh ang situation,

    naay text box and button kon mo butang ta og number sa textbox automatic siya mo add sa last value
    nga imong g,butang ...soo mo increment siya bahh.

    bisan asa sa javascript or php.. pero dli sya gamitan og sql..

  2. #2
    native JS. sowayi daw? kulang nlng validator pra mo validate if number ba ang textbox

    <script>
    function moAdd(balyo){
    balyo = balyo+1;
    document.getElementById('yklaro').value = balyo;
    }
    </script>
    <body>
    <form>
    <input type="text" id="yklaro" value="0"/>
    <input type="button" value="Increment" onclick="moAdd(document.getElementById('yklaro').v alue); return false"/>
    </form>
    </body>

  3. #3
    ts paste daw sa imong code.

  4. #4
    assignment ni TS o gamiton ni sa imong project?

    dali ra mani...JavaScript lang ug HTML...daug na.

    post daw imong code diri TS.. kay atong himolbolan...

  5. #5
    Quote Originally Posted by cebu_user View Post
    ts paste daw sa imong code.
    mga boss ang problem aneh kung e click nmo ang refresh button. mo add ang last mga g.input nmo..

    <?php


    session_start();

    if(isset($_SESSION['total']) && isset($_POST['mon'])){
    $_SESSION['total']=$_SESSION['total']+ ($_POST['mon']);}
    else{
    $_SESSION['total']=0;

    }

    echo "Total :". $_SESSION['total'];


    ?>

    <form action ="ses.php"method = "POST">
    Money : <input type = "text" name = "mon">
    <input type = "submit" value = "add">

    </form>

  6. #6
    para asa ni $_SESSION['views']

  7. #7
    $_SESSION['total'] = intval($_SESSION['total']) + intval($_POST['mon']);
    para asa mana imu views?

  8. #8
    Hmmm.....

    gusto nmo nga ma.retain gihapon ang values even if i.refresh nmo ang browser? What if ma.close na ang browser, inig open nmo kay same gihapon ang values or back to zero?

    simple filehandling would do.

    dali ra na TS.

    Kung para lang ni sa page views...file handling functions gamita.

    fopen & fwrite lang na.

    algo:
    fopen file
    read content/value
    increment value by 1
    fwrite value to file
    display value to HTML.

  9. #9
    Quote Originally Posted by ondoy View Post
    para asa ni $_SESSION['views']
    sori boss $_SESSION['total'] .. na siya oi.. heheheheh

  10. #10
    Quote Originally Posted by ChaosOrb View Post
    Hmmm.....

    gusto nmo nga ma.retain gihapon ang values even if i.refresh nmo ang browser? What if ma.close na ang browser, inig open nmo kay same gihapon ang values or back to zero?

    simple filehandling would do.

    dali ra na TS.

    Kung para lang ni sa page views...file handling functions gamita.

    fopen & fwrite lang na.

    algo:
    fopen file
    read content/value
    increment value by 1
    fwrite value to file
    display value to HTML.
    thank you for this idea. Boss..

  11.    Advertisement

Similar Threads

 
  1. Looking For: PHP + JAVASCRIPT, GOOGLE API programmer NEEDED!
    By dodie in forum Jobs
    Replies: 7
    Last Post: 11-02-2014, 02:04 PM
  2. Port Already in Use (Installing PHP)
    By euan in forum Programming
    Replies: 19
    Last Post: 09-21-2012, 09:48 PM
  3. php, javascript, css - asa ta pede ka sideline?
    By iNef0 in forum Websites & Multimedia
    Replies: 2
    Last Post: 10-29-2009, 04:46 PM
  4. PHP + JAVASCRIPT, GOOGLE API programmer NEEDED!
    By dodie in forum Programming
    Replies: 2
    Last Post: 10-20-2009, 03:41 PM
  5. JAVASCRIPT: how to object value from window.open()
    By hybrid_X in forum Programming
    Replies: 0
    Last Post: 04-09-2007, 01:45 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