Tuesday, April 2, 2013

How radio buttons, depending on what you select a text field in the form that is required should I do?

Uncertainty created by Allen H: How do you make a text field on a form required based on what radio button is selected?

What I’m trying to do is to make certain fields (text boxes) required based on which radio button is selected. For example, if someone selects the “Email” radio button, only the name and email address would be required. If someone has selected the “US Mail” radio button, the Name, Address, City, State and Zip Code fields would be required.


Can anyone provide me with some assistance?


That is certainly remarkable facts about How do you make a text field on a form required based on what radio button is selected? that you could be will have to fix situations individually. Hopefully this helps in lots of ways; and will make your own life better. Dreaming remarkable facts about How do you make a text field on a form required based on what radio button is selected? could well be a cure later on.

Best answer:


Answer by stopitallready

With out knowing your exact situation and what language you’re using, here is a general idea of how you would handle it.


submit button


if(emailRadioButton.checked == true)

{

if(string.isnull(emailTesxBox.text)

{

console.writeline(“Please enter an email address”);

emailTextBox.focus();

return;

}

else

{

// Do stuff

}

}

else if(USMailRadioButton.checked == true)

{

if(string.isnull(USMailTesxBox.text)

{

console.writeline(“Please enter an email address”);

emailTextBox.focus();

return;

}

else

{

// Do stuff

}

}


1. Determine which radio button is checked.

2. See if appropriate text boxes are filled.

3. Either process the data or throw error.


Hope this helps,


Eli


Learn better?

Leave all your answer within a comments!


Part 2: http://beautifulemails.com/2-how-to-create-html-email-html/ Part 3: http://beautifulemails.com/3-how-to-create-html-email-testing/ Free Email Templat…


Video Email Marketing


Shot due to Video Email Marketing


73% of marketers agree that integrating video into email marketing and newsletters increases the click-through rate of those emails. Read more about Video Newsletters .


How radio buttons, depending on what you select a text field in the form that is required should I do?

No comments:

Post a Comment

Blog Archive