You can use setCustomValidity
:
<form action="http://www.google.com" onSubmit="return validate();">
<input type="url"
oninvalid="setCustomValidity('custom message ')"
onchange="try{setCustomValidity('')}catch(e){}" required="true" />
<input type="submit" value="Submit">
</form>
In mozilla this can be achived using:
x-moz-errormessage="custom message"
In your case there are two cases; blank and custom message. For this particular condition
following code will work:
<form action="http://www.google.com" onSubmit="return validate();">
<input type="url"
oninvalid="setCustomValidity(validity.typeMismatch
? '(custom) wrong url '
: '(custom)Field cannot be blank ')"
onchange="try { setCustomValidity('') } catch (e) {}" required="true" />
<input type="submit" value="Submit">
</form>
you can write your own code as per your requirement referring to the following page
Constraint Validation: Native Client Side Validation for Web Forms
Try the following link also , i haven't tried it but it may be of help for you,
Custom messages in HTML5