I recently sent several online work applications, and received a response for one of them, and for my surprise this company was a subcontractor of one that had already sent my application previously, so 15 days later i receive a response from that contractor (offering me a job ) So I quit my job to get this position ( better pay and more benefits ), But now my old employer say, that I have to wait until a month to start work, (because that is not legal)

For better understanding.

I send several applications online to ( A,B ) jobs.

An i get response from (A), so i get the job.

(A) is a subcontractor of (B), So, after 15 days (B) respond to my job request and offers me a job.

Now (A) says that's not legal, that i can not change, i must be unemployed for at least a month before starting work with (B)

Is this true ?