473,326 Members | 2,061 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

message box

47
hi sir.. i had a problem.... i want to make my page friendly user.... i had change my databse table with unique so that when user reclick the save button will came out warning sign... it work..! but how can i get the warning sign if there is duplicate entry, came out message box..?? if no duplicate entry it will save into database... so that means there had 2 message box... one if duplicate entry it will alert the user.. if no duplicate entry,will display message box that say data successfully save
Jul 30 '08 #1
5 1432
acoder
16,027 Expert Mod 8TB
Show your code so far and what you've attempted.
Jul 30 '08 #2
azura
47
[HTML]<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>PBL Group Registration | Medic Assessment System</title>
<link href="css/lgblue.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
.style1 {font-family: Arial, Helvetica, sans-serif}
.style23 {color: #000000}
.style19 {
font-size: 12px
}
.style2 {color: #FFFFFF}
.style3 {color: #333333; }
#form1 { background-color: #FFFFFF;
}
.style24 {color: #000000; font-weight: bold; }
.style25 {font-family: Arial, Helvetica, sans-serif; font-weight: bold; }
.style27 {font-size: 12px; font-weight: bold; }
body {
background-color: #FFFFFF;
}
.style28 { font-family: Arial, Helvetica, sans-serif;
font-size: 12px;
font-weight: bold;
}
-->
</style>
<script type="text/javascript">
<!--
function MM_popupMsg(msg) { //v1.0
alert(msg);
}
function MM_setTextOfTextfield(objId,x,newText) { //v9.0
with (document){ if (getElementById){
var obj = getElementById(objId);} if (obj) obj.value = newText;
}
}

function MM_jumpMenu(targ,selObj,restore){ //v3.0
eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
if (restore) selObj.selectedIndex=0;
}
//-->
</script>
</head>
<body>
<form name="form1" method="post" action="" >
<div align="left" class="style28">
<table width="500" border="1" align="center">
<tr>
<td height="33" colspan="4"><div align="center" class="style24">Medic Assessment System</div></td>
</tr>
<tr>
<td height="26" colspan="4"><div align="center" class="style25 style23"> Group Registration</div></td>
</tr>
<tr>
<td width="99" class="style1"><div align="right" class="style3 style19"><strong>Year </strong>:</div></td>
<td width="128" class="style1">
<div align="left">
<select name="value" id="year" onChange="MM_jumpMenu('parent',this,0)">
<option value="#">Please select</option>
<option value="?value=1 block 1&group=<? echo $_GET['group'] ?>" <?php if($_GET['value']=='1 block 1'){echo"selected=\"selected\"";} ?>>1 block 1</option>
<option value="?value=1 block 2&group=<? echo $_GET['group'] ?>" <?php if($_GET['value']=='1 block 2'){echo"selected=\"selected\"";} ?>>1 block 2</option>
<option value="?value=1 block 3&group=<? echo $_GET['group'] ?>" <?php if($_GET['value']=='1 block 3'){echo"selected=\"selected\"";} ?>>1 block 3</option>
<option value="?value=1 block 4&group=<? echo $_GET['group'] ?>" <?php if($_GET['value']=='1 block 4'){echo"selected=\"selected\"";} ?>>1 block 4</option>
<option value=" "> </option>
<option value="?value=2 block 1&group=<? echo $_GET['group'] ?>" <?php if($_GET['value']=='2 block 1'){echo"selected=\"selected\"";} ?>>2 block 1</option>
<option value="?value=2 block 2&group=<? echo $_GET['group'] ?>" <?php if($_GET['value']=='2 block 2'){echo"selected=\"selected\"";} ?>>2 block 2</option>
<option value="?value=2 block 3&group=<? echo $_GET['group'] ?>" <?php if($_GET['value']=='2 block 3'){echo"selected=\"selected\"";} ?>>2 block 3</option>
<option value="?value=2 block 4&group=<? echo $_GET['group'] ?>" <?php if($_GET['value']=='2 block 4'){echo"selected=\"selected\"";} ?>>2 block 4</option>
<option value=" "> </option>
<option value="?value=3 block 1&group=<? echo $_GET['group'] ?>" <?php if($_GET['value']=='3 block 1'){echo"selected=\"selected\"";} ?>>3 block 1</option>
<option value="?value=3 block 2&group=<? echo $_GET['group'] ?>" <?php if($_GET['value']=='3 block 2'){echo"selected=\"selected\"";} ?>>3 block 2</option>
<option value="?value=3 block 3&group=<? echo $_GET['group'] ?>" <?php if($_GET['value']=='3 block 3'){echo"selected=\"selected\"";} ?>>3 block 3</option>
<option value="?value=3 block 4&group=<? echo $_GET['group'] ?>" <?php if($_GET['value']=='3 block 4'){echo"selected=\"selected\"";} ?>>3 block 4</option>
<option value=" "> </option>
<option value="?value=4 block 1&group=<? echo $_GET['group'] ?>" <?php if($_GET['value']=='4 block 1'){echo"selected=\"selected\"";} ?>>4 block 1</option>
<option value="?value=4 block 2&group=<? echo $_GET['group'] ?>" <?php if($_GET['value']=='4 block 2'){echo"selected=\"selected\"";} ?>>4 block 2</option>
<option value="?value=4 block 3&group=<? echo $_GET['group'] ?>" <?php if($_GET['value']=='4 block 3'){echo"selected=\"selected\"";} ?>>4 block 3</option>
<option value="?value=4 block 4&group=<? echo $_GET['group'] ?>" <?php if($_GET['value']=='4 block 4'){echo"selected=\"selected\"";} ?>>4 block 4</option>
</select>
</div></td>
<td width="89" class="style1"><div align="right" class="style3"><span class="style27">Session </span>:</div></td>
<td width="156" class="style1"><div align="left" class="style3">
<label>
<input name="sessi" type="text" id="sessi" size="15" maxlength="15" value="2008/2009"/>
</label>
</div></td>
</tr>
<tr>
<td class="style1"><div align="right" class="style3"><span class="style27">PBL Group</span> :</div></td>
<td class="style1"><div align="left" class="style3">
<label>
<select name="group" size="1" id="group" onChange="MM_jumpMenu('parent',this,0)">
<option value="#">Please select</option>
<option value="?value=<? echo $_GET['value']?>&group=1" <?php if($_GET['group']=='1'){echo "selected=\"selected\"";} ?>>1</option>
<option value="?value=<? echo $_GET['value']?>&group=2" <?php if($_GET['group']=='2'){echo "selected=\"selected\"";} ?>>2</option>
<option value="?value=<? echo $_GET['value']?>&group=3" <?php if($_GET['group']=='3'){echo "selected=\"selected\"";} ?>>3</option>
<option value="?value=<? echo $_GET['value']?>&group=4" <?php if($_GET['group']=='4'){echo "selected=\"selected\"";} ?>>4</option>
<option value="?value=<? echo $_GET['value']?>&group=5" <?php if($_GET['group']=='5'){echo "selected=\"selected\"";} ?>>5</option>
<option value="?value=<? echo $_GET['value']?>&group=6" <?php if($_GET['group']=='6'){echo "selected=\"selected\"";} ?>>6</option>
<option value="?value=<? echo $_GET['value']?>&group=7" <?php if($_GET['group']=='7'){echo "selected=\"selected\"";} ?>>7</option>
<option value="?value=<? echo $_GET['value']?>&group=8" <?php if($_GET['group']=='8'){echo "selected=\"selected\"";} ?>>8</option>
<option value="?value=<? echo $_GET['value']?>&group=9" <?php if($_GET['group']=='9'){echo "selected=\"selected\"";} ?>>9</option>
<option value="?value=<? echo $_GET['value']?>&group=10" <?php if($_GET['group']=='10'){echo "selected=\"selected\"";} ?>>10</option>
<option value="?value=<? echo $_GET['value']?>&group=11" <?php if($_GET['group']=='11'){echo "selected=\"selected\"";} ?>>11</option>
<option value="?value=<? echo $_GET['value']?>&group=12" <?php if($_GET['group']=='12'){echo "selected=\"selected\"";} ?>>12</option>
</select>
</label>
</div></td>
<td class="style1"><div align="right"><span class="style3"></span></div></td>
<td class="style1"><div align="left"><span class="style3"></span></div></td>
</tr>
</table>

<div align="center"></div>
<div align="center"></div>
<div align="left"></div>
<div align="left">
<p>&nbsp;</p>
<table width="416" height="70" border="1" align="center">
<tr>
<td width="87" height="33"><span class="style23"><strong>Matric No</strong></span> </td>
<td width="7"><div align="center">:</div></td>
<td width="300"><input name="matric" type="text" class="style28" id="matric" value="<?php echo $row_viewer['matric_no']; ?>" size="15" maxlength="15" /></td>
</tr>
<tr>
<td height="29" bgcolor="#FFFFFF"><span class="style23"><strong>Name</strong></span></td>
<td><div align="center">:</div></td>
<td><input name="name" type="text" class="style28" id="name" value="<?php echo $row_viewer['name']; ?>" size="50" maxlength="50"/></td>

</tr>
</table>
</div>
</div>
<p>&nbsp;</p>
<div align="left">
<input type="hidden" name="MM_insert" value="form1" />
</div>
<p>
<form action="" method="post" name="form3">
<blockquote>
<blockquote>
<blockquote>
<p align="center">
<input name="saved" type="submit" class="style28" id="saved" value="Save" onclick="alert('duplicate entry!'),return confirm('successfully saved')"/>
<input name="reset" type="reset" class="style28" id="reset" value="Reset" />
</p>
</blockquote>
</blockquote>
</blockquote>
</form>
</p>
<p>&nbsp;</p>
</form>
<form name="form2" method="post" action="">
<tr>
<td height="307" bordercolor="#000000" bgcolor="#000000" border="0"><p>&nbsp;</p>
<p>&nbsp;</p>
<table width="696" height="60" border="1" align="center" bordercolor="#000000">
<tr>
<td width="92" height="28" class="style3"><div align="center" class="style28"><strong>Matric_No</strong></div></td>
<td width="216" class="style3"><div align="center" class="style28"><strong>Name</strong></div></td>
<td width="71" class="style3"><div align="center" class="style28"><strong>Sessi</strong></div></td>
<td width="75" class="style3"><div align="center" class="style28"><strong>Year</strong></div></td>
<td width="67" class="style3"><div align="center" class="style28"><strong>Group</strong></div></td>
<td width="66" class="style3"><div align="center" class="style28"><strong> Status </strong></div></td>
<td width="63" class="style3"><div align="center" class="style28"><strong>Delete</strong></div></td>
</tr>

<?php do { ?>
<tr>
<td height="24" class="style3 style2 style4"><div align="left" class="style28">
<div align="center"><?php echo $row_all['matric_no']; ?></div>
</div></td>
<td class="style3 style2 style4"><div align="left" class="style28"><?php echo $row_all['name']; ?></div></td>
<td class="style3 style2 style4"><div align="center" class="style28"><?php echo $row_all['sessi']; ?></div></td>
<td class="style3 style2 style4"><div align="center" class="style28"><?php echo $row_all['year']; ?></div></td>
<td class="style3 style2 style4"><div align="center" class="style28"><?php echo $row_all['group']; ?></div></td>
<td class="style3 style2 style4"><div align="center" class="style28"><?php echo $row_all['status']; ?></div>
<td class="style3 style2 style4"><div align="center">
<input name="del_id[]" type="checkbox" class="style28" value="<?php echo $row_all['matric_no']; ?>" />
</div>
<?php } while ($row_all = mysql_fetch_assoc($all)); ?></table>
<p align="right" class="style2 style4">
<label></label>
</p>
<div align="center"></div>
<blockquote>
<blockquote>
<blockquote>
<blockquote>
<blockquote>
<blockquote>
<blockquote>
<blockquote>
<blockquote>
<blockquote>
<blockquote>
<blockquote>
<blockquote>
<blockquote>
<blockquote>
<blockquote>
<blockquote>
<blockquote>
<blockquote>
<blockquote>
<p align="left" class="style2 style4">


<input name="button" type="submit" class="style28" id="button" onclick="return confirm('Are you sure you wish to delete the selected rows?')" value="Delete" />
</p>
</blockquote>
</blockquote>
</blockquote>
</blockquote>
</blockquote>
</blockquote>
</blockquote>
</blockquote>
</blockquote>
</blockquote>
</blockquote>
</blockquote>
</blockquote>
</blockquote>
</blockquote>
</blockquote>
</blockquote>
</blockquote>
</blockquote>
</blockquote>
<p align="center" class="style23"><a href="menu_individu.php">Back </a> | <a href="main.php">Module Menu</a> | <a href="<?php echo $logoutAction ?>" onclick="MM_popupMsg('You\'re successfully logout from this system...')">Logout</a></span></p>

<p class="style2 style4">&nbsp;</p></td>
<input type="hidden" name="value" id="value" value="<? echo $_GET['value'] ?>" />
<input type="hidden" name="group" id="group" value="<? echo $_GET['group'] ?>" />
</form>
<embed name="CS1210559072500" src="Windows Notify.wav" loop="false" autostart="false" hidden="true" width="0" height="0" enablejavascript="true"></embed>
</body>
</html>
<?php
if ((isset($_POST["name"])) && ($_POST["name"] == "")) {
mysql_free_result($viewer);

mysql_free_result($all);
}
?>
[/HTML]
Jul 30 '08 #3
acoder
16,027 Expert Mod 8TB
To check for a duplicate entry, make an Ajax request to a PHP script which checks for duplicate entries. Call this function from the save button onclick (line 148 in your code).
Jul 30 '08 #4
azura
47
got it!! thank you sir!!
Jul 31 '08 #5
acoder
16,027 Expert Mod 8TB
You're welcome. Glad to help :)
Jul 31 '08 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Hugh Welford | last post by:
Hi Using WIN XP and FP2000 Using CDO.message to out put a message from my site, I get the following error message 8004020f from using the code:- strsql = "SELECT * FROM details WHERE patid...
8
by: Brian Keating EI9FXB | last post by:
Would I be correct in saying that the only way to get a user message into a Windows form would be to use P/Invoke with Message? Of is there some part of the .NET API that I am totally un aware...
8
by: Rod | last post by:
I have been working with ASP.NET 1.1 for quite a while now. For some reason, opening some ASP.NET applications we wrote is producing the following error message: "The Web server reported...
2
by: Microsoft News | last post by:
What I have is a message box that pops up. It is another browser window. The code is a general function that you pass message, title and a key to. The box works great except, that if you are on a...
0
by: ronscottlangham | last post by:
I am working on a custom WCF EndpoingBehavior that will modify the messages coming in and out of my Service. I am having an error related to the modification of the message in the...
2
by: =?Utf-8?B?QWRl?= | last post by:
HI All, I am encountering the following error when I try to send an email through a SMTP server. I believe the problem lies with the authentication part when the network crednetials are used,...
3
by: Steven Allport | last post by:
I am working on processing eml email message using the email module (python 2.5), on files exported from an Outlook PST file, to extract the composite parts of the email. In most instances this...
0
by: Philluminati | last post by:
I have a Perl SOAP Server which returns this SOAP Message when invoked: <?xml version="1.0" encoding="UTF-8"?><soap:Envelope xmlns:xsi="http:// www.w3.org/2001/XMLSchema-instance"...
2
by: bernd | last post by:
Hi netties, posted this in a different group already, which seems to be inappropriate. I create a message queue with msgget(), sent a 5-byte message to it with msgsnd() and try to receive the...
2
by: forums_mp | last post by:
Facing a design problem here and I'm not sure how to solve this. The system consists of bi-directional communication between a subject communicating with two (at least for now ) listeners. ...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.