Jump to content

Recommended Posts

macam mana nak link kan select option ni ke page2 die..

contoh

<HEAD>

<TITLE>.: SISTEM PEMANTAUAN PERSEDIAAN TAPAK (SPPD) :.</TITLE>

<link href="main.css" rel="stylesheet" type="text/css" />

</HEAD>

<script type=text/javascript>

function validateForm(formlogin)

{

if(!validRequired(formlogin.userid,"user ID."))

return false;

if(!validRequired(formlogin.password,"kata laluan."))

return false;

if(!validRequired(formlogin.id_kem,"kategori."))

return false;

}

function validRequired(formField,fieldLabel){

var result=true;

if(formField.value==""){

alert('Sila masukkan '+fieldLabel);

formField.focus();

result=false;

}

return result;

}

</script>

<BODY BGCOLOR=#FFFFFF LEFTMARGIN=0 TOPMARGIN=0 MARGINWIDTH=0 MARGINHEIGHT=0 scroll=no>

<!-- ImageReady Slices (update_info1.psd) -->

<br><br><br><br>

<?

// jika user tidak logout lagi akan kuar page dibawah

if($_REQUEST['logout']==NULL)

{

?>

<TABLE WIDTH=800 BORDER=0 CELLPADDING=0 CELLSPACING=0 align=center">

<TR>

<TD background="images/bg_login.gif" WIDTH=800 HEIGHT=452 valign="top" align="center">

<table><TR><TD width="443" align="center"><p><strong>

SISTEM PEMANTAUAN PERSEDIAAN TAPAK (SPPD)<br><br>

JABATAN PERKHIDMATAN AWAM MALAYSIA (JPA)</strong><br>

</TD></TR></table>

<form name="formlogin" action="includes/login_check.php" method="post" onSubmit="return validateForm(this)">

<table border="0" width="313" cellpadding="0" cellspacing="2">

<td width="155"><strong><font face="Verdana, Arial, Helvetica, sans-serif" size="2">ID Pengguna &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </font></strong><font face="Verdana, Arial, Helvetica, sans-serif" size="2"><font size="1">(No. Pekerja/ No. Matrik)</font></font></td>

<td width="152">:

<input name="userid" type="text" size="15" maxlength="10"/></td>

</tr>

<tr>

<td><strong><font face="Verdana, Arial, Helvetica, sans-serif" size="2">Katalaluan</font></strong></td>

<td>:

<input name="password" type="password" size="15" maxlength="10" /></td>

</tr>

<tr><td colspan="2">

<p><br>

<strong><font face="Verdana, Arial, Helvetica, sans-serif" size="2">SILA

PILIH KATEGORI : </font></strong></p>

<p><strong><font size="2" face="Verdana, Arial, Helvetica, sans-serif">

<select name="select">

<option>KEMENTERIAN</option>

<option>SETIAUSAHA DALAM NEGERI</option>

</select>

</font></strong></p></td></tr>

<tr><td colspan="2">

</td></tr>

<tr><td colspan="2" align="center"><br><input name="Submit" class='buttonSubmit' type="submit" value="Login" size="10">

<input name="reset" type="reset" value="Reset" size="10"></td></tr>

</table>

<br> <table border="0" cellpadding="3" cellspacing="0" width="100%">

<tbody><tr>

<td class="isi"><div align="center"><font face="Verdana, Arial, Helvetica, sans-serif" size="1"><font face="Verdana, Arial, Helvetica, sans-serif" size="1"><font color="#003399" size="-7">@JABATAN

PERKHIDMATAN AWAM MALAYSIA (JPA)</font></font></font></div></td>

</tr>

</tbody></table>

<? }else{?>

<br><br><br>

<center><font size="4"><a href="index.php" target="_top">Logout berjaya ! Klik disini </a></font></center>

<br>

<? }

if (isset($_GET['login])) {

echo"

<table width='400' border='0' cellpadding='0' cellspacing='1' align='center'>

<tr>

<td align=center>

<font color=#FF0000>".$_GET['login']."</font>

</td>

</tr>

</table>";

}

?>

</form>

</TD>

</TR>

<TR>

<TD background=images/index_07.gif" WIDTH=800 HEIGHT=19></TD>

</TR>

</TABLE>

</BODY>

yg option kementerian tu bila klik kat situ akan trus ke link:

<HEAD>

<TITLE>.: SISTEM PEMANTAUAN PERSEDIAAN TAPAK (SPPD) :.</TITLE>

<link href="main.css" rel="stylesheet" type="text/css" />

<?

require ("includes/dbconnect.php");

require ("includes/settings.php");

$querykem = mysql_query("SELECT * FROM kementerian ");

?>

<div align="center"><strong><font face="Verdana, Arial, Helvetica, sans-serif" size="2">SILIH

PILIH KATEGORI : </font></strong></td></tr> </div>

<tr>

<td colspan="2"> <div align="center">

<select name="id_kem">

<option value="" selected></option>

<? $bil=1;

// akan menyenaraikan kementerian yang ada

while($listkem = mysql_fetch_array($querykem)){

?>

<option value="<?=$listkem['kod_kem]?>">

<?=$listkem['nama_kem']?>

</option>

<?

}

?>

</select>

</div></td>

</tr>

<tr>

<td colspan="2" align="center"><div align="center"><br>

<input name="Submit" class='buttonSubmit' type="submit" value="Submit" size="10">

<input name="reset" type="reset" value="Back" size="10">

</div></td></tr>

</table>

<br> <table border="0" cellpadding="3" cellspacing="0" width="100%">

<tbody><tr>

<td class="isi"><div align="center"><font face="Verdana, Arial, Helvetica, sans-serif" size="1"><font face="Verdana, Arial, Helvetica, sans-serif" size="1"><font color="#003399" size="-7">@JABATAN

PERKHIDMATAN AWAM MALAYSIA (JPA)</font></font></font></div></td>

</tr>

</tbody></table>

</TD>

</TR>

<TR>

<TD background="images/index_07.gif" WIDTH=800 HEIGHT=19></TD>

</TR>

</TABLE>

</BODY>

tolon ye...aku xtau pape psl php ni...hrp leh blajo

Share this post


Link to post
Share on other sites

alamak...bley terangkan apa masalahnye?

mcm ni saya nak buat satu page dimana user boleh pilih sama ada klik pada (kerajaan atau suk )pada list menu..tp mcm mane nak buat bile user tu klik kat kerajaan die akan link ke page senarai kerajaan...atas tu coding sy wat..xtau la... :blush:

Share this post


Link to post
Share on other sites

bawak value untuk setiap list menu,pastu wat comparation dengan skrip untuk value tersebut untuk re-direct link.

gud luck

ha mcm mane tu>bukan pakai href eh..td try xleh pn..hehhehe

Share this post


Link to post
Share on other sites

<html>
<head>
<script type="text/javascript">
function gotVal(){
d=document.getElementById('selectOption').value
if(d=="1"){
window.location.href="page1.html"
}
if(d=="2"){
window.location.href="page2.html"
}
}
</script>
</head>
<body>
<select id="selectOption" onchange="gotVal()">
<option value="1">value 1</option>
<option value="2">value 2</option>
<option value="3">value 3</option>
</select>
</body>
</html>

simple example.hope you find the idea.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...