Validate between 2 textboxes

  • Thread starter light of mind. heavy of belly
  • Start date
L

light of mind. heavy of belly

Hi,

I need to validate that at one of 2 textboxes has some data in it. Is it
possible to hook the validation system to do this bearing in mind that empty
textboxes are not evaluated?

Thanks for your ideas.
 
T

tamayi

I'm not sure of any way you can use the validator controls in this
scenarios. It would be much easier to write a small Javascript that
check the values of those controls.

a single IF statement would actually do the trick.
 
L

light of mind. heavy of belly

Hmm, I really wanted to hook this stuff to the validation bits for
consistency's sake.
 
L

light of mind. heavy of belly

OK, so how would I go about doing that exactly?

Heres my first attempt at calling some client script:

protected void Page_Load(object sender, EventArgs e)

{

string script = @"

<script language=JavaScript>

function doEmailOrPhoneCheck(){

alert('here');

return false;

}

</script>";

RegisterClientScriptBlock("onSubmitCheck", script);

SubmitButton.Attributes.Add("onsubmit", "onSubmitCheck");

}

What am I doing wrong?

Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,564
Members
45,039
Latest member
CasimiraVa

Latest Threads

Top