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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.