Pada input text, akan disenaraikan cadangan perkataan utk dimasukkan. Macam nak masukkan alamat e-mail, baru taip "a", dia senaraikan email2 yang ada huruf a sbg cadangan
<?php $sql="SELECT * FROM ipms_user a, ipms_ref_area b WHERE a.user_type = 'm' AND a.seating_group = 'R' AND a.area_id = b.area_id"; $res = mysql_query($sql) or die(mysql_error()); ?> <form name="form1" method="post" action="<?php echo $_SERVER['PHP_SELF'].'?module=aum&op=senaraiSoalanMP&ptrid='.$ptrid.''?>"> <br><br><br> <strong>Pilih MP :</strong> <script language="javascript" type="text/javascript" src="actb.js"></script> <script language="javascript" type="text/javascript" src="common.js"></script> <? $i=0; $senarainama=""; while ($row = mysql_fetch_array ($res)) { $ar_dato[$i] = $row['full_name']." [".$row['area_name']."]"; $i++; } for($i=0; $i<count($ar_dato);$i++) { $senarainama .= "'".str_replace("'", "\'", $ar_dato[$i])."',"; } ?> <script> var customarray=new Array(<? echo $senarainama ?>''); </script> <input type='text' style='font-family:verdana;width:300px;font-size:12px' id='tb' name='mp' value=''/> <script> var obj = actb(document.getElementById('tb'),customarray); //setTimeout(function(){obj.actb_keywords = custom2;},10000); </script> <p> <input type="reset" name="Reset" value="Batal"> <input type=hidden name="ade" value=1> <input type="submit" name="Submit" value=" Pilih MP " onClick="return validate(form1)"> </p> </form>
www.nursyuhada.com