Wrox Programmer Forums
|
ASP.NET 1.0 and 1.1 Basics ASP.NET discussion for users new to coding in ASP.NET 1.0 or 1.1. NOT for the older "classic" ASP 3 or the newer ASP.NET 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 4th, 2007, 01:54 PM
Authorized User
 
Join Date: Sep 2006
Posts: 82
Thanks: 0
Thanked 0 Times in 0 Posts
Default Button / Form Query

Hi there,

I wondered if someone can point me in the right direction ? Within an asp.net website, designed in asp.net 1.1 with vb.net 2003, I have created a form that includes text boxes for payment address details and another small form which has delivery address details.

Within the form I have created a button that copies the address details from the payment address to the delivery address details. This all worked fine until I added some validation controls i.e.
required validation controls to ensure all such fields were completed. Since adding the validation controls to the delivery address form, the copy address details buttons has stopped working. Now I suspect this is linked to the validation controls but any ideas how I can overcome this without moving the form for the delivery address details onto a separate form.

Here's some of the code below :

Button sub-procedure :

Code:
 'Copies payment address details to delivery address fields
     Sub btnCopy_Click(sender As Object, e As EventArgs)
          If Page.IsPostBack Then
           'Set DeliveryName text box to equal the PaymentName text box entry
            txtDName.Text = txtName.Text
            txtDAddress.Text = txtAddress.Text
            txtDCity.Text = txtCity.Text
            txtDCounty.Text = txtCounty.Text
            txtDPcode.Text = txtPcode.Text
            txtDCountry.Text = txtCountry.Text
        'End If
     End Sub

Example of form :


 <tr class="cellfillalt">
<td width="140">
<div class="lbltxt" align="right">Post Code: </div></td>
<td width="260">
 <p align="center"><asp:TextBox id="txtDPcode" Runat="Server" Size="30" 

MaxLength="30"></asp:TextBox>
 </p></td>
 <td width="160">
 <asp:RequiredFieldValidator id="RFDPcode" runat="server" ForeColor=" " ErrorMessage="Enter 

delivery post code" CssClass="formerror" 

ControlToValidate="txtDPcode"></asp:RequiredFieldValidator></td></tr>
Thanks




 
Old June 4th, 2007, 02:14 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,189
Thanks: 5
Thanked 59 Times in 57 Posts
Send a message via MSN to gbianchi
Default

hi there.. probably the new button you added is validating the form... just change causevalidation to false and you will be ok...

HTH

Gonzalo

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from dparsons signature and he Took that from planoie's profile
================================================== =========
My programs achieved a new certification (can you say the same?):
WORKS ON MY MACHINE
http://www.codinghorror.com/blog/archives/000818.html
================================================== =========
I know that CVS was evil, and now i got the proof:
http://worsethanfailure.com/Articles...-Hate-You.aspx
================================================== =========
 
Old June 5th, 2007, 11:52 AM
Authorized User
 
Join Date: Sep 2006
Posts: 82
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Worked a treat - thanks






Similar Threads
Thread Thread Starter Forum Replies Last Post
Close all MdiChield form from open one form/Button salman .NET Framework 2.0 6 December 10th, 2007 03:21 AM
Button Query rsm42 ASP.NET 1.0 and 1.1 Basics 5 August 1st, 2007 10:19 AM
Reset Button Query rsm42 ASP.NET 1.0 and 1.1 Basics 3 April 3rd, 2007 02:52 PM
Assigning Command Button to Query young20 Access VBA 1 November 6th, 2006 12:15 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.