Jump to content

Javascript help


riddhi

Recommended Posts

here is my java code that I am using:-

 

function checkShippingAndPaymentInfo()
{
with (window.document.frmCheckout) {
	if (isEmpty(txtShippingFirstName, 'Enter first name')) {
		return false;
	} else if (isEmpty(txtShippingLastName, 'Enter last name')) {
		return false;
	} else if (isEmpty(txtShippingAddress1, 'Enter shipping address')) {
		return false;
	} else if (isEmpty(txtShippingPhone, 'Enter phone number')) {
		return false;
	} else if (isEmpty(txtShippingState, 'Enter shipping address state')) {
		return false;
	} else if (isEmpty(txtShippingCity, 'Enter shipping address city')) {
		return false;
	} else if (isEmpty(txtShippingPostalCode, 'Enter the shipping address postal/zip code')) {
		return false;
	} else if (isEmpty(txtPaymentFirstName, 'Enter first name')) {
		return false;
	} else if (isEmpty(txtPaymentLastName, 'Enter last name')) {
		return false;
	} else if (isEmpty(txtPaymentAddress1, 'Enter Payment address')) {
		return false;
	} else if (isEmpty(txtPaymentPhone, 'Enter phone number')) {
		return false;
	} else if (isEmpty(txtPaymentState, 'Enter Payment address state')) {
		return false;
	} else if (isEmpty(txtPaymentCity, 'Enter Payment address city')) {
		return false;
	} else if (isEmpty(txtPaymentPostalCode, 'Enter the Payment address postal/zip code')) {
		return false;
	} else {
		return true;
	}
}

 

I want that the invalid entry to be displayed as soon as the user enters an invalid input like :-

 If the user enters name beginning with 1 for example a window will pop up informing invalid input. How to do it?

Link to comment
https://forums.phpfreaks.com/topic/49784-javascript-help/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.