Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > client side script - cancel submit...

Reply
Thread Tools

client side script - cancel submit...

 
 
Iain
Guest
Posts: n/a
 
      06-25-2004
I have an <asp:ImageButton ...> which I do some client side validation with
by adding an Attribe for the on click.

How do I tell asp NOT to submit if my function does not validate? I've
tried returning false but to no avail.

I'm sure it's obvious when I know how!

Iain


 
Reply With Quote
 
 
 
 
Iain
Guest
Posts: n/a
 
      06-25-2004
Thanks RSB.

Returning False should work. as i am using this.
> Are you execute another function in the Click function .. if yes make sure
> that you are returning the False in the Click Function.
>

function submitVoucher(thisImg, textName)
{
theImage = thisImg;
var elVC = getElement(textName);
if (VoucherIsOK(elVC))
{
return true;
}
else
{
if (elVC.value.length <17)
alert('You have not entered enough characters for a Voucher
Code.\n Please check and enter again carefully.');
else
alert('You have entered an invalid Voucher Code.\n Please check
and enter again carefully.');
return false;
}
}

is my js function and

GoButton.Attributes.Add("onClick", "submitVoucher(this, '" +
VoucherCode.ClientID + "');");

is how I'm getting it there.

Should this be OK?

Iain


 
Reply With Quote
 
 
 
 
RSB
Guest
Posts: n/a
 
      06-25-2004
Hi Iain,

Returning False should work. as i am using this.
Are you execute another function in the Click function .. if yes make sure
that you are returning the False in the Click Function.

RSB

"Iain" <(E-Mail Removed)> wrote in message
news:#(E-Mail Removed)...
I have an <asp:ImageButton ...> which I do some client side validation with
by adding an Attribe for the on click.

How do I tell asp NOT to submit if my function does not validate? I've
tried returning false but to no avail.

I'm sure it's obvious when I know how!

Iain



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Client side script after client side validation with asp.net 2.0 Boss302 ASP .Net 0 11-21-2006 08:43 AM
Cancel serverside event using client side event csgraham74 ASP .Net 5 06-14-2005 10:17 PM
Server-side script with input parameter from Client-side script Magnus Blomberg ASP .Net 3 04-14-2005 12:21 PM
HELP CANCEL CANCEL CANCEL Carmen Rosario Computer Support 7 04-06-2005 11:04 PM
Stop client side validation for DataList cancel button moondaddy ASP .Net 1 04-03-2004 04:24 AM



Advertisments