Announcement

Collapse
No announcement yet.

How to maintain what the user key in after alert box appear?

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to maintain what the user key in after alert box appear?

    How I want maintain what the user key in after alert box appear; window.alert('No rujukan tidak dijumpai'). Please help me.
    <?php session_start(); ?>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

    <html>
    <head>
    </head>

    <body>
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
    <tr>
    <td>
    <p class="title"><b>PENGESAHAN PENDAFTARAN</b></p>
    <div class="content">

    <?php
    if(isset($_POST['seterusnya']))
    {
    $template = $_POST['template'];
    $no_rujukan = $_POST['no_rujukan'];

    if($template == 'template_perlembagaan')
    {
    echo "<script language='Javascript'>navigate('semak.php')</script>";
    exit();
    }

    if($template == 'template_sendiri')
    {
    include('../config/conn_db.php');

    $result = mysql_query("SELECT no_rujukan FROM semakan_kaunter WHERE no_rujukan = '$no_rujukan'")
    or die ("No Rujukan tidak jumpa");

    $matched = mysql_fetch_array($result);

    if($matched){
    echo "<script language='Javascript'>navigate('semak.php')</script>";
    exit();
    }

    else{
    echo("<SCRIPT LANGUAGE='JavaScript'>
    window.alert('No rujukan tidak dijumpai')
    </SCRIPT>");
    }
    }
    }
    ?>

    <form id="form1" name="form1" method="post" action="">

    <table id="t1" width="356" border="0">
    <tr>
    <td colspan="3"><strong>Pilihan Perlembagaan</strong></td>
    </tr>

    <tr>
    <td colspan="3">
    <input type="radio" name="template" value="template_perlembagaan" />
    Template Perlembagaan
    <br />

    <input type="radio" name="template" value="template_sendiri" />
    Perlembagaan Sendiri
    <br /></td>
    </tr>

    <tr>
    <td width="20">&nbsp;</td>
    <td colspan="2">Nombor Rujukan Semakan:
    <input type="text" name="no_rujukan" id="textfield" /></td>
    </tr>
    <tr>
    <td>&nbsp;</td>
    <td width="127">&nbsp;</td>
    <td width="198">&nbsp;</td>
    </tr>
    <tr align="right">
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td><input type="submit" name="seterusnya" value="Seterusnya" /></td>
    </tr>
    <tr align="right">
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td><label></label></td>
    </tr>
    </table>
    <br/>
    </form>
    </div>
    </td>
    </tr>
    </table>

    </body>
    </html>
Working...
X