Re: Which button was clicked to cause validation?
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.javascript archive

Re: Which button was clicked to cause validation?

From: Thomas 'PointedEars' Lahn <PointedEars@web.de>
Date: Wed Nov 30 2005 - 17:23:10 CET

ujjc001@gmail.com wrote:

> asp button. has server side code. has a custom validator.
> The server side code does not execute until the validation has ran.

So it is completely irrelevant here, yes?

> in the client side javascript code for the custom validator, can I call
> any type of a function to see what event caused the page to attempt
> submit hence calling all validation.
> Yes it's in a form.
> The two buttons are btnSearchAddress and btnSearchParcel.
> For instance, when <asp:customvalidator id="val_cust_ByAddress"
> runat="server" Display="None"
>
ClientValidationFunction="val_cust_ByAddress_ClientValidate"></asp:customvalidator>
> runs it calls
> [...]
> and in there I want to test if search by address was clicked or by
> parcel.

Perhaps

  function val_cust_ByAddress_ClientValidate(sender, args, action)
  {
    // use the value of action
  }

  <input type="button" name="foo"
         onclick="val_cust_ByAddress_ClientValidate(..., ..., this.name)">

? If not, post the code the _client_ gets, i.e. the server generates.
Only relevant snippets of it, of course.
 
> Here's some more of the code.
> [...]

Who on Earth is supposed to read this junk?
You should at least post properly formatted code.

PointedEars
Received on Sat Dec 3 04:33:39 2005