Results 1 to 10 of 10

Thread: parse value dari textbox ke textbox...URGENT

  1. #1
    Join Date
    Jan 2008
    Location
    shah lama
    Posts
    6
    Rep Power
    0

    Question parse value dari textbox ke textbox...URGENT

    mcm nie..aku kena buat system keputusan pelajar...contohnya jika aku masukan markah pelajar dlm textbox tu dpt markah BM=80 ..outomatik sdpt "A"..aku dh try IF else statement..tp tak jadi ar..mcm mana aku nak total kn jumlah markah..pastu nak kira peratus pelajar tu yekk..
    kepada otai2 bantuan anda amatlah diperluakan
    mcm mana aku nk buat yekk..

    PHP Code:
    <form name="form1" method="post" action="">
                            <
    p>Keputusan Peperiksaan:-</p>
                  <
    table width="344" border="1">
                    <
    tr>
                      <
    td width="167"><div align="center">Matapelajaran</div></td>
                      <
    td width="85"><div align="center">Markah</div></td>
                      <
    td width="70"><div align="center">Gred</div></td>
                    </
    tr>
                    <
    tr>
                      <
    td>Bahasa Melayu </td>
                      <
    td>
                        <
    div align="center">
                          <
    input type="text" size="4" name="MarkahBM">
                        </
    div></td>
                      <
    td><div align="center">
                     <
    input type="text" size="4" name="GredBM">
                     <if 
    MarkahBM 40 then
                     GredBM
    ="A">
                      </
    div></td>
                    </
    tr>
                    <
    tr>
                      <
    td>Bahasa Inggeris</td>
                      <
    td>
                        <
    div align="center">
                          <
    input type="text" size="4" name="MarkahBI">
                        </
    div></td><td><div align="center">
                          <
    input type="text" size="4" name="GredBI">
                        </
    div></td>
                    </
    tr>
                    <
    tr>
                      <
    td>Sejarah</td>
                      <
    td>
                        <
    div align="center">
                          <
    input type="text" size="4" name="MarkahSejarah">
                        </
    div></td><td><div align="center">
                          <
    input type="text" size="4" name="GredSejarah">
                        </
    div></td>
                    </
    tr>
                    <
    tr>
                      <
    td>Matematik</td>
                      <
    td>
                        <
    div align="center">
                          <
    input type="text" size="4" name="MarkahM3">
                        </
    div></td><td><div align="center">
                          <
    input type="text" size="4" name="GredM3">
                        </
    div></td

  2. #2
    Join Date
    Jun 2001
    Location
    Mystic Kingdoms
    Posts
    2,749
    Rep Power
    274
    apa language nih?
    php? asp?

    tak pernah lak aku jumpa php kod : <if


  3. #3
    Join Date
    Jan 2008
    Location
    shah lama
    Posts
    6
    Rep Power
    0
    lupe nak inform aku pakai dreamweaver...

  4. #4
    Join Date
    Jan 2008
    Location
    shah lama
    Posts
    6
    Rep Power
    0
    Quote Originally Posted by mysticmind View Post
    apa language nih?
    php? asp?

    tak pernah lak aku jumpa php kod : <if

    aku baru lahh bro..
    baru nak blajar2..tolong ar aku...heheheheh

  5. #5
    Join Date
    Jun 2001
    Location
    Mystic Kingdoms
    Posts
    2,749
    Rep Power
    274
    inilah masalah lazim orang bergantung software..
    software bukan segalanya.

    berdasarkan apa yang nak dibuat, anda memerlukan PROGRAMING yang boleh memproses input. Samada ASP atau PHP (dan yang sepertinya).. yang mana tidak mungkin mampu dipelajari sebulan dua, apatah lagi seminggu..

    Selain tuh boleh try javascript.

  6. #6
    Join Date
    Jan 2008
    Location
    shah lama
    Posts
    6
    Rep Power
    0

    Question

    Quote Originally Posted by mysticmind View Post
    inilah masalah lazim orang bergantung software..
    software bukan segalanya.

    berdasarkan apa yang nak dibuat, anda memerlukan PROGRAMING yang boleh memproses input. Samada ASP atau PHP (dan yang sepertinya).. yang mana tidak mungkin mampu dipelajari sebulan dua, apatah lagi seminggu..

    Selain tuh boleh try javascript.
    aku buat nie pakai PHP..aku dh habis cube tgk buku semua dah ..tp tak sure funtion dia nak eltak mana??

    bantuan ana amatlah diperlukan...

  7. #7
    Join Date
    Jun 2001
    Location
    Mystic Kingdoms
    Posts
    2,749
    Rep Power
    274
    dia tak bleh letak merata2..
    kene tahu camner nak letak.
    tapi kalau still guna dreamweaver susah la..
    coding bukan bergantung software.
    ia bergantung ilmu

    nak cakap camner pun susah..
    yang pasti.. kene belajar basic php dulu..
    antaranya camner nak display data dari form.

    kerana kesian.. saya sertakan contoh simple:

    borang.htm
    HTML Code:
    <form method="post" action="papar.php">
    masukkan nama anda : <input type="text" name="nama">
    <input type="submit" name="hantar"><br>
    </form>
    php lak
    papar.php
    PHP Code:
    <?
    $nama
    =$_POST['nama'];
    ?>
    Hai <? echo $nama ?> !. Selamat Datang!
    Try.. tapi tolong research, kat mana boleh php nih JALAN.
    bukan bleh run gitu2 jer.. hosting pun kene tgk hosting ape.
    Last edited by mysticmind; 12-01-2008 at 12:09 PM.

  8. #8
    Join Date
    Jan 2008
    Location
    shah lama
    Posts
    6
    Rep Power
    0
    kalu dalam JS mana nak buat..

    aku nak biler user masuk kat markah dlm markahBM tu contohnya dpt 80..automatik kat textbox gredmarkahBM tu papar "A"..

  9. #9
    Join Date
    Jan 2008
    Location
    shah lama
    Posts
    6
    Rep Power
    0

    Unhappy

    Code:
    <script language="JavaScript">
    
    function markah(form)
    {
      var MarkahBM = form.MarkahBM.value;
      var MarkahBI = form.MarkahBI.value;
      var MarkahSejarah = form.MarkahSejarah.value;
      var MarkahM3 = form.MarkahM3.value;
      var Markahsains = form.Markahsains.value;
      var MarkahIslamMoral = form.MarkahIslamMoral.value;
      var Markahseni = form.Markahseni.value;
      var Markahjasmani = form.Markahjasmani.value;
      
      var Jummar = (MarkahBM*1)+(MarkahBI*1)+(MarkahSejarah*1)+(MarkahM3*1)+(Markahsains*1)+(MarkahIslamMoral*1)+(Markahseni*1)+(Markahjasmani*1);
      form.JumlahMarkah.value = Jummar.toFixed(0);
      
      var Jumperatus = (Jummar/800)*100;
      form.Peratusmarkah.value = Jumperatus.toFixed(0);
      }
      
    function gred(form)
    {
     var MarkahBM = form.MarkahBM.value;
      var BM
       if (MarkahBM >=80)
      {
      BM = "A";
      form.GredBM.value = BM;
      }
      
      }
    </script>
    aku berjaya buat utk kira jumlah markah n jumlah peratus...

    tapi utk gre aku berjaya untuk dred 80 keatas jer..
    aku tak reti nak kembangkan If statement ni dlm JS...

    bantuan....bantuan....bantuan....bantuan....bantua n....bantuan....bantuan....bantuan....

  10. #10
    Join Date
    Apr 2004
    Location
    Ampang
    Posts
    18
    Rep Power
    0
    Quote Originally Posted by arsenalfc82 View Post
    aku berjaya buat utk kira jumlah markah n jumlah peratus...

    tapi utk gre aku berjaya untuk dred 80 keatas jer..
    aku tak reti nak kembangkan If statement ni dlm JS...
    Tak kira dalam language apa pun. Kalau dah guna IF, untuk keadaan lain gunakan else if atau else
    ""If you must break the law, do it to seize power: in all other cases observe it." - Julius Caesar

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Salam dari Singapura
    By latiff in forum Member Introductions
    Replies: 1
    Last Post: 02-12-2009, 04:05 PM
  2. Salam dari selayang
    By Zizei in forum Member Introductions
    Replies: 1
    Last Post: 22-09-2008, 02:23 PM
  3. Hello..saya dari kajang
    By LiveTraining in forum Member Introductions
    Replies: 0
    Last Post: 18-01-2008, 12:42 AM
  4. Parse error
    By therion in forum Website Programming
    Replies: 25
    Last Post: 20-05-2004, 02:41 PM
  5. how to make function that automatically parse url
    By full time kille in forum Website Programming
    Replies: 6
    Last Post: 08-11-2002, 05:59 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
  •  

Search Engine Optimization by vBSEO 3.5.0 RC1 PL1

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30