The medium does not change the substantive conditions. You still need the parties' consent and capacity, a defined and lawful object, and a lawful cause.
In Tunisia, Law No. 2000-83 of 9 August 2000 applies the written-contract rules to electronic contracts as regards consent, legal effect, validity and performance, unless the law provides otherwise (art. 1). The Code of Obligations and Contracts provides that a contract by correspondence is formed at the time and place where the offeree accepts.
In Morocco, where writing is required for validity, it can be drawn up and kept in electronic form (art. 2-1 of the Code of Obligations and Contracts, DOC). For contracts concluded online, the offer must state the means of correcting input errors, and the recipient must be able to check the order and its total price before confirming; the offeror acknowledges receipt without undue delay (arts. 65-4 and 65-5).
In the United Arab Emirates, Federal Decree-Law No. 46 of 2021 provides that an electronic document does not lose its evidential value or enforceability merely because it is electronic.