CBWP2203 Web Programming Semester January 2011
CBWP2203 Web Programming Semester January 2011
CBWP2203
WEB PROGRAMMING
MATRICULATION NO :
IDENTITY CARD NO. :
TELEPHONE NO. :
E-MAIL :
LEARNING CENTRE : BATU PAHAT
CBWP2203
a) assignment.html
2
CBWP2203
b) course_info.html
3
CBWP2203
</tr>
</table>
</body>
</html>
4
CBWP2203
c) display.html
<style type="text/css">
<!--
.h2 {
font-family: Arial;
font-size: 20px;
font-weight: bold;
color: blue;
}
.style2 {
font-family: Arial;
font-size: 18px;
font-weight: bold;
color: black;
}
-->
</style>
</head>
<body bgcolor="#E3E4FA">
<h2 align="center" class="h2">
Welcome to my webpage for<br />
CBWP2203 Assignment<br />
5
CBWP2203
6
CBWP2203
d) controls.html
<style type="text/css">
<!--
.style1 {
font-family: Tahoma;
font-size: 14px;
color: black;
font-weight: bold;
}
-->
</style>
</head>
<body bgcolor="#6698FF">
7
CBWP2203
</form>
</body>
</html>
8
CBWP2203
e) htmljavascript.html
<script type="text/javascript">
/* <![CDATA[ */
function trim(s)
{
return s.replace(/^\s+|\s+$/, '');
}
function validateEmail(fld) {
var error="";
var tfld = trim(fld.value);
var emailFilter = /^[^@]+@[^@.]+\.[^@]*\w\w$/ ;
if (fld.value == "") {
alert("You didn't enter an email address.");
} else if (!emailFilter.test(tfld)) { //test email for illegal characters
alert("Please enter a valid email address.");
} else {
alert("Your email address is valid, thank you!");
}
return error;}
9
CBWP2203
function processButton(){
var alertString = String("You are interested in: ");
10
CBWP2203
alert(alertString);
}
/* ]]> */
</script>
</head>
<body>
<tr>
<td>Name:</td>
<td> <input type="text" id="name" size="30" /></td>
<td> </td>
</tr>
11
CBWP2203
<tr>
<td>Email Address:</td>
<td> <input type="text" id="fld" size="30" /></td>
<td> <input type="button" value="Validate" onclick='validateEmail(fld)' /></td>
</tr>
</table>
<br />
<br />
<br />
<br />
<input type="checkbox" name="pilihan1" value="1" /> I'm interested in your programmes
offered. <br />
<input type="checkbox" name="pilihan2" value="2" /> I'm interested in short courses. <br />
<input type="checkbox" name="pilihan3" value="3" /> I'm interested in visiting your
campus. <br />
<br />
<input type="button" value="Process" onclick='processButton()' />
</form>
</body>
</html>
12
CBWP2203
f) vbscript.html
13
CBWP2203
14
CBWP2203
REFERENCES
1. Aziz, M.J. (et.al). (2010). CBWP2203 Web Programming. Seri Kembangan, Selangor:
Pearson Prentice Hall.
2. Checkbox.checked : Checkbox. (2009). Retrieved March 12, 2011, from Javascript
Tutorial: http://www.java2s.com/Tutorial/JavaScript/0200__Form/Checkboxchecked.htm
3. Checkboxes in XHTML MP. (2004). Retrieved March 12, 2011, from XHTML MP
Tutorial:
http://www.developershome.com/wap/xhtmlmp/xhtml_mp_tutorial.asp?page=inputElem
ents3
4. Help with "&&" Logical Operator And If Statement. (n.d.). Retrieved March 12, 2011,
from Dream.In.Code: http://www.dreamincode.net/forums/topic/89602-help-with-
logical-operator-and-if-statement/
5. Javascript : Form Validation. (2009). Retrieved March 12, 2011, from Javascript : Form
Validation: http://www.webcheatsheet.com/javascript/form_validation.php
6. Javascript and XHTML. (2011). Retrieved March 12, 2011, from Javascript and
XHTML: http://javascript.about.com/library/blxhtml.htm
7. Johansson, R. (2008, July 8). Choosing the right doctype for your HTML documents.
Retrieved March 12, 2011, from Dev.Opera: http://dev.opera.com/articles/view/14-
choosing-the-right-doctype-for-your/
8. Lomax, P. (2001). Learning VBScript. Retrieved March 12, 2011, from
http://oreilly.com/catalog/vbscript/excerpt/ch01.html
9. Patton, T. (2007, June 11). Choosing the right document type for web pages. Retrieved
March 12, 2011, from Tech Republic: http://www.techrepublic.com/blog/programming-
and-development/choosing-the-right-document-type-for-web-pages/409
10. Quinn, L. (2005). Choosing a Doctype. Retrieved March 12, 2011, from WDG Web
Design Group: http://htmlhelp.com/tools/validator/doctype.html
15