Friday, April 25, 2014

HTML: Post your data into a popup window

Rather than posting the data to a new page, you might need have to post the data to a popup. Therefore, this would help you to get a rough idea on how to do that. (Things get pretty interesting when you learn new stuff everyday. :D)

Source code of the main html file - index.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
<html xmlns="">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Simple Form</title>
<script language="javascript" type="text/javascript">
  function submitForm(formName){
 var popupWin ="",formName,"status,height=540,width=500,resizable=yes,scrollbars=yes");
<form action="formResults.php" method="post" name="myForm" target="popupWin" onsubmit="javascript:submitForm(;">
Name:<br /><input name="name" type="text" size="50" maxlength="50" /><br />
Address:<br /><input name="address" type="text" size="50"/><br />
<input name="submit" type="submit" value="Submit the form data to a popup"/>

Here's the simple form that I would be posting the data to - formResults.php
Your name is: 
<br />
  echo $_REQUEST["name"]
<br />
<br />
Your address is: 
<br />
  echo $_REQUEST["address"]
* Click here for the demo shown in this post.

Sunday, April 20, 2014

I have more time to prepare for this...

This would be second IT show of the year 2014 and we are 7 weeks away from it. And since there's a lot of time left, I can begin my simple game of comparison and decide what are the new stuff that I should be getting. :P

Image taken from 'PC Show 2014' website.

By the way, by accessing the official website of 'PC Show 2014', you can
also gain access to information like, 'How to get there', 'The floor plan',
'On-site and Online Contests', etc...

  • Date: 5 - 8 June 2014
  • Opening Hours: 12pm to 9pm
  • Location: Singapore Expo Halls 5 & 6

* Click here to find out more about 'PC Show 2014'.
^ Click here for the unofficial 'PC Show 2014' site.
  (You can gain access to all the pricelist of all the Exhibitor @ 'PC Show 2014'.
  Although currently there isn't a lot but the list will gradually increase once
  the 'show' starts.)

Thursday, April 10, 2014

AngularJS: Select element + filter function

If you are going to use a <select> element in your website that is going to build on top of AngularJS, and at the same time if you ended up using a mixture of normal <option> element and <select> element with ng-repeat, rather than using ng-show to hide some of the elements, it might be better to use a filter function.

* Click here to access the demo that I have created on 'JSFiddle'.
^ Click here to test your JavaScript, CSS, HTML or CoffeeScript online with JSFiddle code

Sunday, April 6, 2014

Checking for Unicode Characters using Regular Expressions

When there's a need to validate a mixture of strings and unicode characters, it's kinda irritating when you have to throw in all the crazy conditioning statements. Luckily now there's Regular Expressions that can help us to make our job much more easier for example...

* Click here to view a demo of unicode characters matching using Regular Expression.
^ Click here for the list of ascii characters and their corresponding entities.