last day (1271 days later) » 

1:21 PM
@RegDwightАΑA wow that didn't take long
 
Moving at the speed of light!
 
Ohai!
 
I feel special, I've never owned a chat room before
 
I was just digging up the Programmer's chat, but it seems like there is some intense gossip over there.
This makes sense though. Might as well here as anywhere else.
Anyway. Um, I have a search form. I click the search button, but my validation doesn't run. It barfs.
 
Yeah so I was talking to Suzy at the baker's yesterday, and she said...
 
1:23 PM
I'm guessing it is because my usual method doesn't work for a postback.
But I'm not sure what then.
$(".dataSubmit").click(function (e) {
        e.preventDefault;
        return validatePage();
    });
So the e.preventDefault; I'm thinking is not caring about a simple postback.
Do you know what I should use instead?
 
Well, postback is an ASP thing. I'm not sure what ASP does under the hood. However, I think that one of two things will happen: 1. e.preventDefault will block the postback, or 2. postBack will happen even if your click handler fails, because ASP attached their own click handler.
What kind of element is ".dataSubmit"? button? input type=button? input type=submit?
 
shrugs I use an ASP button. I think the default behavior is 'submit.'
 
@KitFox you could view the source...
 
user19161
This room feels spacious.
 
@Mr.ShinyandNew安宇 Well, I know, but I was just doing that.
 
1:27 PM
@KitFox :)
 
It is submit.
As I was pretty sure that I recalled.
 
so when you click the button, what is the behaviour you are seeing?
 
It errors on an improper input.
 
As in, it correctly displays an error message if the form data isn't valid?
 
As in YSOD.
 
1:29 PM
Oh, it gives an error on the server side
 
I think it runs the validation, but there is nothing to prevent the postback if the input is incorrect.
 
If you give it correct form data, does it work properly?
 
Yes.
And if it is incorrect, it will automatically display a proper error message to the user, but you can submit the form anyway.
Hmm. Looks like maybe I need to use stopPropagation
 
You could also try attaching to the form submission handlers
 
Hmm. Maybe.
 
I guess I will poke it for a while. Why can't my codez just behave?
 
@KitFox yeah, seriously
I've been screwing around all week and my code still hasn't written itself
 
Thanks for the halps.
 
I am trying to cover my huge slacknerness by pretending that I've been working on this.
Assuming of course, that I would be able to figure it out easily.
Which is not going to plan.
Hey @Mr.Shiny? Uh, what if I just change this from an ASP button to a button? With input = button?
Oh, no wait, that won't work.
 
1:51 PM
It's hard for me to say what will happen because your html code is generated by ASP which has its own stuff on top of basic html
 
Well, and I forgot I have to execute some code there too.
 

  last day (1271 days later) »