Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Skip Validation....

Status
Not open for further replies.

wsmall73

Programmer
May 23, 2002
261
US
I am trying to get some reuse out of a window. If in the querystring I pass a task_no the page runs using that task_no (executing stored procedures etc) ... the task no being shown as a label on the webform.
if the task_no is not included... I want the user to be able to search by entering a task_no in a textbox and when the user hits the enter key then try to reload the window using the entered task_no.
I have added code in the code behind to trap for when I have not received a task_no as part of the querystring.. I hide the label and show the textbox for entry. I have added the attribute keypress to the textbox and trapped for the 'enter' (13) keycode. The issue is that when I recognize the enter key I set the location of the window to
window.location.href="addHistory.aspx?task_no="+ll_task_no; using JavaScript and that causes validation and the user gets notified that they haven't entered dates etc on the page... I would like to obviously skip the validation in this instance...

any idea.... sorry for the long post. TIA -W
 
I'm not entirely sure this will help you but are you aware that you can assign a button with this attribute:

causesValidation = "false"

SO in your html your button might look like:
Code:
<asp:button id=&quot;btn&quot; onCLick=&quot;btn_OnClick&quot; causesValidation=&quot;false&quot; runat=&quot;server&quot; />
Not sure if that's of use but it might be ! ;) i love chocolate
 
thanks for the response... I am aware of the ability to add that to buttons but the validation is not being caused by a button click it is being caused by the changing of the window's location via javascript window.location.href=&quot;BLAH BLAH&quot;

ps. I love chocolate too.. =)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top