AleMonteiro 238 Can I pick my title?

Anyway, I played a little with that fiddle and came up with this: http://jsfiddle.net/L4nqhudr/1/

Is that what you want?

AleMonteiro 238 Can I pick my title?

Hi Rustatic. The .NET Framework doesn't allow you to do it directly, but you can add an 'Hook' using User32.dll.

Here are some resources that should walk you trought it:
http://support.microsoft.com/en-us/kb/319524
https://sim0n.wordpress.com/2009/03/28/vbnet-mouse-hook-class/

AleMonteiro 238 Can I pick my title?

Hi all. This is somewhat the equivalent of .NET String.Format(String, Args);

Usages:

'Hello {0}'.format('DaniWeb!');

String.format('{0} {1} {2}', 'Hi', 'Again', 'Good Fella');

String.format('Hello {prefix} {name}', { prefix: 'Sr.', name: 'HeyHeyHey'});

I know there's lots of String.formats out there(some simpler and some more complex), but this is the one i've been using for the past years and it works really well for me.

Remarks: I didn't write this from scratch, couple years ago I put together a couple of simpler sinnepts to make this one. But I couldn't find the sources to give the deserved credits.

Hope it may be helpful.

Cheers!

JorgeM commented: very nice! +12
AleMonteiro 238 Can I pick my title?

I think the easiest way is to do it with ClickOnce. You will need an FTP to publish the app in, and an HTTP so your users can download it.

Each time the app launches it'll check for updates on the same path it was downloaded from. So you can just publish another version and relax.

ClickOnce it's really easy to use: https://msdn.microsoft.com/en-us/library/31kztyey.aspx

If you want more control and are willing to learn it, I never used, but heard good things about NSIS: http://nsis.sourceforge.net/Main_Page

AleMonteiro 238 Can I pick my title?

Hi Suzie, It's nice that you decided to focus on a language, and it really saves time when you already got a lot done. But "base classes" are just the tip of the iceberg if you really want structured and reusable code.

Just a quick example of why, in my opnion, base classes are not enough: Imagine that you create an base class that adds DataBase and Log functions to all your WebPages. What happens when you need to create a Windows Form, WPF or Console app? Or even a WebService?

So, before the base class, you need to create your libraries or choose open source ones, and I'd even say: you need both.
Then, you can create base classes that implement those libs in a easy to use fashion way, so you need to write even less code into your custom projects.
And you can go even further by creating templates that already use your base class and alrady display the code that you usually customize in your projects.

I don't know the opnion of anybody else on this, but when using Open Source or 3rd party libs I usually create an class to make a "proxy interface" for it, so it's easier to update it if there's a certain revision that needs code ajustment or even if I decide to change the lib for another one later.

Given my opnion, this is basically the current set that I've been building and using for the last couple …

ddanbe commented: Good opinion +15
AleMonteiro 238 Can I pick my title?

You can create a personal web site, a company web site, a blog or anything that does not require back-end logic.

AleMonteiro 238 Can I pick my title?

Hi Niloo.

Apart from the language, there's much to be done before start coding.

A CMS can become a monstruous project. So, the first thing I'd do would be to list down all the functionallities that you'll implement at first. 'Simple' doesn't cover it so well.

With the list at hand you can start to build your database schema, to hold all the info you'll need.

Now, with a list of functions and the basic db schema, you can plan your application architecture. It will be ajax based? The server side will be Object Oriented? What's the interface will look like? The interface will be template based? How the editing interface will look like?

With the answers to a few of that questions and a lot of others more, you'll have a clear picture of what you'll need to code. If you don't, you'll at least have enough info to ask for specific help.

If you're in doubt only about the PHP, specially if you're using MySQL, there's lots of projects that genereate PHP CRUD Classes from DB Schema. I guess a couple of them might use PDO. But I'm not sure, it's been a while since I coded PHP.

Good luck.

diafol commented: Good advice +15
AleMonteiro 238 Can I pick my title?

What you need to learn depends on what you want to do with knowledge.
Do you want knowledge for knowledge or you want to build something? What do want to build?

For me, there's no better way of learning than doing. And I don't think studying only HTML it's much helpfull. You'll need at least CSS to make anything worth to be seen, and probably a little JS later.

So, I suggest that you think of something to build, and build it.

Developmet it's much more than just languagues and coding. There's lot's of stuff to learn, from code editors to browser compability issues.
You can't learn all at once, and learn all before doing something we'll consume lot's of time.

If you learn a little from each subject from each project you work on, with time, you'll have a good knowledge of a broad range of subjects.

AleMonteiro 238 Can I pick my title?

There's no build-in function that does that.
I think the best approach is to search for the tables you want in the information schema and then delete them by name.

Here's a way: http://stackoverflow.com/questions/4393/drop-all-tables-whose-names-begin-with-a-certain-string

AleMonteiro 238 Can I pick my title?

With further evaluation, you could get a little more dynamic...

    var poslow = [1,2,3,4,5,6];
    var poshigh = [7,8,9,10,11,12];


    var popsRounds = [
        [1, undefined, undefined],
        [2, 7, 6],
        [3, 8, 5],
        [4, 9, 4],
        [5, 10, 3],
        [6, 11, 2],
        [7, 12, 1],
        [8, 6, 7],
        [9, 5, 8],
        [9, 4, 9],
        [10, 3, 10],
        [11, 2, 11]
    ];


    // this function displays all the positions on the screen aligned
    // in two rows one row has 1-6 the opposite row has 7-12
    function calculate(round, unshift, push)
    {
        document.write('<p style="color:red;">'+'round ' + round + ' </p>'+"<br/>");
        if ( typeof unshift != 'undefined' ) {
            poshigh.shift();
            poslow.pop();
            poslow.unshift(unshift);
            poshigh.push(push);
        }
        for( j=0, k=0; j < poslow.length, k < poshigh.length; j++,k++)
        {       
            document.write('<p style="color:blue;">'+poslow[j]+" "+poshigh[k]+'</p>');
        }
    }

    for(var i=0,il=popsRounds.length;i<il;i++) {
        var round = popsRounds[i];
        calculate(round[0], round[1], round[2]);

        // Even shorter would be
        // calculate.apply(calculate, popsRounds[i]);
    }
AleMonteiro 238 Can I pick my title?

Yes, mattster, it's quite simple =)

Just keep in mind that if you have more than one instance installed on your DB Server, you'll need to enable SQL Browser and use the instance to connect.
Examples:

  • 192.168.0.120\SQLServer2008InstanceName
  • 192.168.0.120\SQLServer2005InstanceName
  • 192.168.0.120\SQLServer2003InstanceName

Another thing to bare in mind is the login method. If you're going to use Windows Authentication you'll need to use a valid user account in the DB Server.
Example: If you are using ASP.NET hosted on IIS:

<identity impersonate="true" 
          userName="dbserverdomain\username"
          password="password"/>

If you're going to use SQL Server Authentication, it's quite simpler, just set User Id and Password at the connection string.

AleMonteiro 238 Can I pick my title?

Envato is really nice, I never published anything, but I bought a pretty Adobe After Effects template and a great song to go in the background. Works wonders.

About w3schools certification, I'd say it's nice to test yourself. I got 96% in JavaScript and got really excited about it =)

mattster commented: nice one! +4
AleMonteiro 238 Can I pick my title?

Certifications may help but I don't think they are essential at all.

What gives you credit on the web is what you have done for the web.
If you have a beautiful and fufilling portfolio it will be credit enough.

Of course that a pretty portfolio doesn't mean much if your clients and users complain about you and don't give good recommendations.

If you are starting, get a few small jobs with your friends and acquainteds. Don't charge much, in the begning it's more important to get experience and portfolio.

Good luck.

AleMonteiro 238 Can I pick my title?

You're welcome.

Just mark as solved =)

AleMonteiro 238 Can I pick my title?

It's printing twice because you're calling it twice..

Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        worker1 = New Thread(AddressOf test)
        ' Logging "test" for first time
        worker1.Start() 
        ' Logging "Ready"
        log(logconsole, "Ready")
        'Logging "test" for second time
        test() 
    End Sub
robert.knighton.79 commented: thanks! I thought it had to be something silly like that! +0
AleMonteiro 238 Can I pick my title?

That's exactly what I posted. =)

AleMonteiro 238 Can I pick my title?

That's probably because your method returns an int.
Try this:

public string Execute_SQL(string select)
        {
            ConnectiontoSQL();
            string Query = "select " + select + " from jobSearch where searchID = 1";
            DataSet ds = SelectSQL(Query);
            if ( ds.Tables[0].Rows.Count > 0 ) { // Found something
                // Returns the first cell of the first row
                return ds.Tables[0].Rows[0][0].ToString();
            }
            // Exit code for no item found
            return "-1";
        }
AleMonteiro 238 Can I pick my title?

Ok... so, using AJAX, in your case, the data will be inserted into DOM after the response from the HTTP request(ajax).

The simpliest way to insert data recieved from ajax is if that is already HTML, so you don't have to parse it, just insert.
Another way is to recieve an XML or JSON object and use JavaScript to parse into into HTML or even go trought it and insert separeted DOM nodes

I suggest you start by using jQuery ajax methods, it's easy to learn.

Take a look at this article: http://blog.teamtreehouse.com/beginners-guide-to-ajax-development-with-php
Or some more direct approach: http://brian.staruk.me/php/2013/sample-jquery-php-ajax-script/

There's lots of material about Ajax and PHP out there, some are really good.

AleMonteiro 238 Can I pick my title?

If I'm not mistaken this will work fine:

INSERT INTO TableOne(Id, Name) VALUES(1, 'Name 01'); INSERT INTO TableTwo(Id, IdFK, Name) Values(1, 1, 'Name 01 01');
safi.najjar1 commented: thanks man, It worked with me but I want to know how to do it with trigger +0
AleMonteiro 238 Can I pick my title?

Did you try like this?

$(document).ready(function(){
    $("#del_event").live("click", function(){
        var events = $("input[name=event_id]").val();
        alert(events);

        if(confirm("Are you sure ?"))
        {
            $.ajax
            ({
                type = "post",
                url = "EMS/DelEvent.php",
                data = events,
                success: function(){
                    alert("event deleted!");
                }
            });
            return false;
        }
    });
});
AleMonteiro 238 Can I pick my title?

Ok, that's great, but you didn't mark it yet, please do so =)

AleMonteiro 238 Can I pick my title?

This page is the same page that show the HTML? If so, all this code is being executed before any user interaction...

I suggest that you create an hidden input to know what do to... example:

<?php
    if ( $_POST["formAction"] == "insert" ) {
        // Insert code goes here
    }
?>

<input type="hidden" name="formAction" value="none"/>

<button type="submit" onclick="document.form.formAction.value = 'insert'; return true;">Send</button>
AleMonteiro 238 Can I pick my title?

Hi, first of all, put some description at your post, don't just drop the code.

So the problem seems to be that you can execute the stored procedure, right? Do you have permission to do so with the account your are logged in? Who is the owner of the SP? Try using the fully classified name like 'dbo.regionSelect'.

AleMonteiro 238 Can I pick my title?

Where do you call the initialize function?
The error is telling you that you are trying to set the header after you started the output.

AleMonteiro 238 Can I pick my title?

I ain't sure, but I think you can't do it with backup (.bak).

What you can do it's generate scripts from the 2008 to the 2005:

1.Right click on the DB -> Tasks -> Generate Scripts
2.Select all the objects
3.Click Advanced
    3.1.Change Script for Server Version: SQL Server 2005
    3.2.Change Types of data to script: Schema and Data

If you don't have an working version of your DB in a 2008 enviorement, you'll need to create one.

Hope it helps.

Eagletalon commented: Solid working advice +3
AleMonteiro 238 Can I pick my title?

The problem is that you are using the selector .image but it doesn't exist on your html.

Try this

function showProductPage( pageNo ) {
    var perPage = 2; T
    var start = pageNo * perPage; 
    var end = start + perPage; 
    $('.showproduct').find("div.product").hide().filter(function(index) { 
        return ( (index > (start-1)) && ( index < end ) ); 
    } ).show(); 
}
AleMonteiro 238 Can I pick my title?

I suggest you use jQuery UI to achieve this, it'll be very easy.

Take a look in this demo, it's almost what you want: http://jqueryui.com/button/#splitbutton

This demo uses 3 jQuery UI feature: Button, Menu and Position.

<M/> commented: :) +7
AleMonteiro 238 Can I pick my title?

There is no static guide for DB options, it all depends on your utilization of the engine.

I found this PDF very usefull.

You should also check this microsoft page: http://technet.microsoft.com/en-us/sqlserver/bb671430.aspx

<M/> commented: :) +0
AleMonteiro 238 Can I pick my title?

Hi JorgeM, nice job, very small code.

I took the liberty to change a few things, hope you don't mind.

This is a version with just a small code ajustment: http://jsfiddle.net/grFQp/5/

And this is a version with a closed scope, so it could be easy of use, without worring about variable names being used in another part of the page: http://jsfiddle.net/Q4ang/4/

JorgeM commented: you are a master of JavaScript +12
<M/> commented: :) +0
AleMonteiro 238 Can I pick my title?

I'm not sure, but try like this (it may have syntax issues):

SELECT  SUM( ct.num_prod ), mc.catagory_name
FROM (
    SELECT  COUNT(`product_id`) as num_prod, sub.category_id as cat_id
    FROM  `product_table_1` as p
    INNER JOIN fm_product_sub_category as sub
        ON ( p.sub_cat_id = sub.sc_id )
    GROUP BY
        sub.category_id

    UNION ALL

    SELECT  COUNT(`product_id`) as num_prod, sub.category_id as cat_id
    FROM  `product_table_2` as p
    INNER JOIN fm_product_sub_category as sub
        ON ( p.sub_cat_id = sub.sc_id )
    GROUP BY
        sub.category_id

    UNION ALL

    SELECT  COUNT(`product_id`) as num_prod, sub.category_id as cat_id
    FROM  `product_table_3` as p
    INNER JOIN fm_product_sub_category as sub
        ON ( p.sub_cat_id = sub.sc_id )
    GROUP BY
        sub.category_id

    UNION ALL

    SELECT  COUNT(`product_id`) as num_prod, sub.category_id as cat_id
    FROM  `product_table_4` as p
    INNER JOIN fm_product_sub_category as sub
        ON ( p.sub_cat_id = sub.sc_id )
    GROUP BY
        sub.category_id

    UNION ALL

    SELECT  COUNT(`product_id`) as num_prod, sub.category_id as cat_id
    FROM  `product_table_5` as p
    INNER JOIN fm_product_sub_category as sub
        ON ( p.sub_cat_id = sub.sc_id )
    GROUP BY
        sub.category_id
) 
AS ct , 
fm_product_main_category AS mc

WHERE 
    ct.cat_id = mc.category_id

GROUP BY 
    ct.cat_id

The main difference between our approches, is that yours select all product from all tables and then cont them. My approach count the products from each table and then sum them.

<M/> commented: :) +0
AleMonteiro 238 Can I pick my title?

The problem is making a loot of separeted querys, that's not good. Always go for the least number of database connections possible.

Try like this:

SqlCommand sc = con.CreateCommand();
sc.CommandType = CommandType.Text;

int i = 0;
string sql = string.empty;

foreach (DataRow row in dt_blah.Rows)
{
    // Use ´i´ to keep the parameters names different
    sql += String.Format("select blah blah blah .. where S = @s1{0} and p = @p1{0}", i);    

    sc.Parameters.AddWithValue("@s1" + i, ddl.SelectedValue);
    sc.Parameters.AddWithValue("@p1" + i, row["Category"]);

    i++;
}

sc.CommandText = sql;
con.Open();
    SqlDataAdapter sda = new SqlDataAdapter(sc);
    DataTable dt = new DataTable();
    sda.Fill(dt);
    con.Close();
<M/> commented: :) +0
AleMonteiro 238 Can I pick my title?

Just use (assets.Quantity * stock_names.value) as Total

<M/> commented: :) +0
AleMonteiro 238 Can I pick my title?

When you use innerHTML, scripts are not executed. That's your problem.

So, I suggest that you don't return any JavaScript code on your ajax response.
Instead, just return the divs and then execute a function to add the resize functionality.
Something like this:

function addResizeFunctionality() {
    var
        div = document.getElementById('event-box-container')
        , children = div.childNodes
        , childrenLength = children.length;

    for(var i=0; i < childrenLength; i++) {
        var childrenId = children[i].id;
        var resize = new resize();
        resize.init({id: childrenId, direction: 'y'});
    }

}
LastMitch commented: Nice Work! +11
AleMonteiro 238 Can I pick my title?

Hello everybody.

I'm starting to build an event calendar for employees in my company, and the first thing I needed was an working calendar to build from, so I wrote a simple one.

Hope it can be usefull for someone.

Cheers.

JorgeM commented: great job. would like to see your progress as you further develop it... +12
LastMitch commented: Nice! +11
AleMonteiro 238 Can I pick my title?

Ok, so you can't use an select like from the posts tables. Because if you do, it'll insert for all posts, not only the one that the user selected the tags.

You need to insert the tags for each post, like this:

INSERT INTO post_tag(post_id, tag_id) 
SELECT
    $post_id, tag_id 
FROM
    tag
WHERE
    tag IN ('$music','$sport','$tech')
AleMonteiro 238 Can I pick my title?

Big and complicateds softwares are nothing more than small pieces of code put toggether.

In my opnion, being a programmer is one thing, being a software developer is something more. You need to have the vision of what group of small pieces of code put toggether will achieve the funcionality you desire.
And not only code, what will you use to store your data? How would you integrate your solution with another one? Do you need to consume an 3rd part service or use an 3rd part library? Do you have access to them? Are they open source? Do you need to buy them/the use of them? How would you distribute your software? Will you charge the use of you software? How? What kind of user is your target? And so many more questions...

If you want to develop complete software solutions, you'll need much more knowlodge than just a programming language.

I'll tell something about me: I learned allmost everything that I know in software development by myself, but I did a couple of one week classes too.
I've been working with IT from the past 6 years now, and this is the things that I worked and still work with most of the time:

  • Programming Languagues/Markup Languages
  • Microsoft ASP.NET, Windows Forms, WCF, WPF (C# and VB)
  • Windows Batch, Shell Scripting
  • PHP
  • Java (For Android)
  • JavaScript/JQuery/VBScript/ActionScript
  • XML/HTML/MXML/CSS
  • SQL (Procedures, Triggers and Querys)
  • DataBases
  • SQL Server 2000, 2005 and 2008
  • MySQL 4 and 5
  • Oracle 10 and …
AleMonteiro 238 Can I pick my title?

DateDiff returns an Int not an BigInt, that's why you get the error.

One work arround is to get the minutes and then multiple by 60, to get the seconds, like this:

ABS(CONVERT(BigInt, (DateDiff(minute, grn_date, getDate()))) * 60)

I found the answer in this forum: http://www.sqlservercentral.com/Forums/Topic964359-392-1.aspx

And here it's a more sofisticated analysis: http://sqlanywhere.blogspot.com.br/2010/10/getting-bigint-from-datediff.html

AleMonteiro 238 Can I pick my title?

You can use XmlDocument to parse your xml string and use it to go throw it.
See this example: http://www.csharp-examples.net/xml-nodes-by-name/

AleMonteiro 238 Can I pick my title?

Don,

I used the term "exclusive database" to say an database per client. I mean, each PC that'll run the software will have it's own local database.

Good luck with your project.

AleMonteiro 238 Can I pick my title?

In my opnion, you can't let the end user change the database, NEVER EVER. Any and every change in the database should be done by the software, or only, in very specific cases, by the database administrator.

In your example, you want to let the user change the description in directly in the database. But what it the user add a description contaning &"'^~><-+{]\|%$#@!*&¨?°¬¢£³²¹, would the software accept it?
What it the user remove the description field?

There's many ways that the user can mess up a software by editing the database himself, in my opnion this should never happen.

About the database itself, if every copy of your software will have an exclusive database, I can't suggest anything... lol... I never made an client application with a exclusive database. But I'd guess MSAccess, MySQL or FireBird.
I would never make an application based on a excel database.

However, if your software will connect to a central database, I recommend SQL Server or Oracle. Both have very easy .NET interfaces and are great handling large number of records, large number of connections, and have a lot of nice features that help development and maintanace.

AleMonteiro 238 Can I pick my title?

Check this sample, I got it from Google Maps Docs and just modify it a little bit:

<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
<title>Google Maps JavaScript API v3 Example: Info Window Simple</title>
<link href="http://code.google.com/apis/maps/documentation/javascript/examples/default.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
<script type="text/javascript">

    var beaches = 
    [
      ['Bondi Beach', -33.890542, 151.274856, 4],
      ['Coogee Beach', -33.923036, 161.259052, 5],
      ['Cronulla Beach', -36.028249, 153.157507, 3],
      ['Manly Beach', -31.80010128657071, 151.38747820854187, 2],
      ['Maroubra Beach', -33.950198, 151.159302, 1]
    ];

    function initialize() {

        var myOptions = {
            zoom: 10,
            center: new google.maps.LatLng(0, 0),
            mapTypeId: google.maps.MapTypeId.ROADMAP
        }

        var map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);

        setMarkers(map, beaches);
    }   



function setMarkers(map, locations) {

    var bounds = new google.maps.LatLngBounds();

    for (var i = 0; i < locations.length; i++) 
    {

            var beach = locations[i];

            var coords = new google.maps.LatLng(beach[1], beach[2]);

            var contentString = '<div id="content">'+
                'Info Window Test:' +  beach[0] + 
                '</div>';

            var infowindow = new google.maps.InfoWindow({content: contentString});

            var markerImage = new google.maps.MarkerImage
            (
                "http://www.alawar.com/games_img/games/sky-bubbles/sky-bubbles-deluxe-logosmall.gif",
                new google.maps.Size(44, 44, "px", "px"),
                new google.maps.Point(0, 0),
                new google.maps.Point(0, 0),
                new google.maps.Size(20, 20, "px", "px")
            );

            var marker = new google.maps.Marker({
                position: coords,
                map: map,
                icon: markerImage,
                title: beach[0],
                zIndex: beach[3]
            });

            google.maps.event.addListener(marker, 'click', 
                function (infowindow, marker) {
                    return function () {
                        infowindow.open(map, marker);
                    };
                }(infowindow, marker)
            );

            bounds.extend(coords);
            map.fitBounds(bounds);
    }
}

</script>
</head>
<body onload="initialize()">
  <div id="map_canvas"></div>
</body>
</html>
Jessfly commented: Nice +0
AleMonteiro 238 Can I pick my title?

You're welcome.

Just mark the question as solved please =)

AleMonteiro 238 Can I pick my title?

Let's go to the points:

  1. You need to wait until the DOM is loaded so you can get the reference of an object.

    // This won't work
    var movingBox = document.getElementById("moveBox");
    var topOfBox = movingBox.style.top.value;

    // This should work
    var movingBox, topOfBox;

    window.onload = function() {
    movingBox = document.getElementById("moveBox");
    topOfBox = movingBox.style.top.value;
    };

  2. It's a silly error:

    // "heightIn" is a string, not the value of the heightIn variable
    // This will set the height to an string with value 'heightInpx'
    document.getElementById("moveBox").style.height = "heightIn" + 'px'

    // This should work
    document.getElementById("moveBox").style.height = heightIn + 'px'

AleMonteiro 238 Can I pick my title?

Hi Violet. I'd use more like this:

<html>
    <head>
        <title>test</title>
        <style>
        .theForm{
            background-color:#f4f4f4;
            margin-top:14px;
            padding:25px 0 40px 25px;
            font-size: 0.875em;/* 14/16*/
            color: #333333;
        }
        .theForm #email, .theForm #residence {
            width:52.33333333333333%; /* 314/600*/
        }
        .theForm #theMonth {
            width:14.5%; /* 87/600*/
        }
        .theForm #theYear{
            width:14.5%; /* 87/600*/    
        }

        .theForm a#mandatory{
            font-size:0.75em;/*12/16*/
        }
        .theForm select option{
            color: #333333;
        }
        .theForm #theDay{
            width:14.5%; /* 87/600*/
        }
        .theForm #specificDay{
            width:14.5%; /* 87/600*/    
        }
        .clear{clear:both;}
        #main{
            width:600px;
            margin:0 auto;
        }

        .inline
        {
            position: relative;
            display: -moz-inline-stack;
            display: inline-block;
            zoom: 1;
            vertical-align: top;

            *display: inline;
        }
        .label {
            width: 200px;
        }
        .form-row {
            margin-bottom: 10px;
        }
        /*REGISTER FORM*/
        </style>
    </head>
    <body>
        <div id="main">
            <div class="theForm">
                <form>

                    <div class="form-row">
                        <span class="inline label">Email address:</span><input type="text" name="email" id="email">
                    </div>

                    <div class="form-row">
                        <span class="inline label">theMonth / theYear of birth:</span>
                        <select name="theMonth" id="theMonth">
                            <option value="theMonth"></option>
                            <option value="January"></option>
                            <option value="February"></option>
                            <option value="March"></option>
                            <option value="April"></option>
                            <option value="May"></option>
                            <option value="June"></option>
                            <option value="July"></option>
                            <option value="August"></option>
                            <option value="September"></option>
                            <option value="October"></option>
                            <option value="November"></option>
                            <option value="December"></option>
                        </select>
                        <select name="theYear" id="theYear">
                            <option value="theYear"></option>
                            <option value="1940"></option>
                            <option value="1941"></option>
                            <option value="1942"></option>
                            <option value="1943"></option>
                            <option value="1944"></option>
                            <option value="1945"></option>
                            <option value="1946"></option>
                            <option value="1947"></option>
                            <option value="1948"></option>
                            <option value="1949"></option>
                            <option value="1950"></option>
                            <option value="1951"></option>
                        </select>
                        <a href="#" id="mandatory">Why this?</a>
                    </div>

                    <div class="form-row">
                        <span class="inline label">theDay of resignation:</span>
                        <select name="theDay" id="theDay">
                            <option value="theMonth"></option>
                            <option value="January"></option>
                            <option value="February"></option>
                            <option value="March"></option>
                            <option value="April"></option>
                            <option value="May"></option>
                            <option value="June"></option>
                            <option value="July"></option>
                            <option value="August"></option>
                            <option value="September"></option>
                            <option value="October"></option>
                            <option value="November"></option>
                            <option value="December"></option>
                        </select>
                        <select name="theMonth" id="specificDay">
                            <option value="theYear"></option>
                            <option value="1940"></option>
                            <option value="1941"></option>
                            <option value="1942"></option>
                            <option value="1943"></option>
                            <option value="1944"></option>
                            <option value="1945"></option>
                            <option value="1946"></option> …
AleMonteiro 238 Can I pick my title?

Using AJAX you can show the content to the user in the browser, but not download it.

For downloading a file see this link: http://php.net/manual/en/function.readfile.php

or this one: http://www.terminally-incoherent.com/blog/2008/10/13/php-file-download-script-straming-binary-data-to-the-browser/

AleMonteiro 238 Can I pick my title?

You need to show the div when msg === true:

$('#result').html(quantity+' items');   
$('#result').show();   

// OR, using chaning

$('#result')
    .html(quantity+' items')
    .show();

Also, this is very ugly and with poor performance: $('input:text#quantity').val();
Use just #quantity or as you are already inside the event scope, you could use just $(this).

So, I think this code would be better wrote as:

$('#quantity').keyup(function(){
        var
            quantity = $(this).val()
            , $result = $('#result');

        if(isInteger(quantity))
        {
            var msg = false;
            if(quantity > 1)
            {
                msg = true;
            }

            // more code . . .

            if(msg === true)
            {
                 $result
                    .html(quantity+' items')
                    .show();   
            }
            else
            {
                $result.hide();
            }
        }
    });
cereal commented: perfect! many thanks! +10
AleMonteiro 238 Can I pick my title?

I think it's ok, but I'd use more like this:

function isDuplicate(names,phone,email,adresa){ 
        var isduplicate=false; 

        for(var i=0,il=addresslist.length, addr; i<il, addr=addresslist[i]; i=i+1){ 
            if(    addr.names.toLowerCase()==names.toLowerCase() 
                && addr.phone.toLowerCase()==phone.toLowerCase()
                && addr.email.toLowerCase()==email.toLowerCase()
                && addr.adresa.toLowerCase()==adresa.toLowerCase()
            )
            { 
                isduplicate=true; 
                break; // Stop loop if it's duplicated
            } 
        } 
        return isduplicate; 
    } 

    // Verify if value is only number
function isNumber(val) {
    return !isNaN(parseInt(val));
}
AleMonteiro 238 Can I pick my title?

See if this works:

$(function(){

    $('ul#groupCat li').click(function(){

        var 
            catChoice= $(this).attr('cat'),
            $subMain = $("#subMain");

        if(catChoice == "00"){
            $subMain.find("div.box").slideDown();
            $subMain.find("div.categorie").slideDown().removeAttr('catsort');
            return;
        }

        $subMain
            .find('div.categorie[cat!="' + catChoice + '"]') // div categorie who is not the catChoice
                .slideUp();

        $subMain
            .find("div.categorie[cat=" + catChoice + "]") // div categorie who is the catChoice
                .attr('catsort', 'Yes') 
                .slideDown() 
            .parent() // box who has the catChoice categorie
                .slideDown();

        $subMain
            .find('div.box:not(:has(div.categorie[cat="' + catChoice + '"]))') // Only boxes that does not have the categorie
                .slideUp();
    }); 

});
AleMonteiro 238 Can I pick my title?

Here is how you do it:

function putTime(x,y) {

    var theDate = new Date(x*1000); // convert time value to milliseconds
    var now = new Date(); // Now

    var dif = theDate.getTime() - now.getTime(); // Difference between dates in millisseconds

    // Date is in the past
    if ( dif < 0 )  {
        // Do Something     
    }
    // Date is in the future
    else {
        setTimeout(function() {
            // Code to be executed when the 'now' becames 'theDate'
        }, dif);
    }
}
LastMitch commented: Nice! +9
AleMonteiro 238 Can I pick my title?

Hello and welcome to DaniWeb.

I don't wish to be rude, but please search a little bit in this forum and you'll you find a lot of great answers to your questions.

There's a similar post about learning and starting with Web Developemnt every week.

We're here to help and instruct, but, and I think I can say it for the most of us, aswering the same question over and over again suck the life out of us.

Here are some topics that may help you:
http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/403930/where-to-learn-javascript

http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/443678/need-new-resource-to-learn-javascript

http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/323948/want-to-learn-javascript

http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/356136/where-to-learn-javascript

http://www.daniweb.com/web-development/web-design-html-and-css/threads/129216/is-css-hard-to-learn-how-to-do

http://www.daniweb.com/web-development/web-design-html-and-css/threads/118720/learning-css

http://www.daniweb.com/web-development/web-design-html-and-css/threads/323425/training-to-learn-html-css

http://www.daniweb.com/web-development/web-design-html-and-css/threads/63801/learning-web-design-html-css-etc

Ps.: I don't think that daniweb seach is good enough, so I use google to find what I want, like this:
learn javascript site:DaniWeb.com
learn css site:DaniWeb.com
learn PHP site:DaniWeb.com

Hope it helps and you learn a lot =)