Ask a Question related to Dreamweaver AppDev, Design and Development.
-
ossie #1
ASP.NET Required field validators
Hi
How can I stop a requiredfield validator from validating?
The scenario is that my page has 2 modes "Add" & "Edit"
I have a single form on the page that either populates from the database if
page is in edit mode or blank entries for adding a new record.
When I am entering a new record I have 2 additional fields displayed on the
form that are not required when editing the record, these 2 fields each have
a validator attached to them.
I have tried
If Request.Params("mode") = "edit" then
myValidator1.Visible = False
myValidator1.Enabled = False
myValidator1.IsValid = True
End If
and a combination of the three with no success, I still get the required
field error message when submitting the form in edit mode
Can anyone point me in the right direction please
Many thanks
ossie Guest
-
Web Form Required Field
Not supported. For more form help see - http://www.publishermvps.com/Default.aspx?tabid=30 -- David Bartosik - MS MVP for Publisher help:... -
Required field validators do not while editing a row in a datagrid present in a composite control
Hi All, I have created a composite control and I have added a datagrid in it. I am dynamically adding an edit column for editing the data. Now I... -
Detecting if a field is required
Hi all, i need to detect whether a field is required or not. I'm using this code for building a string to convert later to an array (by Split) of... -
how to enable the required validators in javascript
Jenet: Specify in the OnSubmit event of your FORM element the name of the javascript function you want to call. <form method=post... -
Required field
Newbie question: I have a reservation form and I want to make the email field, a required field. How do I go about doing this? Thanks! Reggie -
Calvin Willman #2
Re: ASP.NET Required field validators
Might be that you need them to stop validating on the Client, in which case,
try setting EnableClientScript to false.
On 18/4/05 9:49 am, in article d3vs6h$qp8$1@forums.macromedia.com, "ossie"
<ossie@microsoft.com> wrote:
> Hi
>
> How can I stop a requiredfield validator from validating?
>
> The scenario is that my page has 2 modes "Add" & "Edit"
> I have a single form on the page that either populates from the database if
> page is in edit mode or blank entries for adding a new record.
>
> When I am entering a new record I have 2 additional fields displayed on the
> form that are not required when editing the record, these 2 fields each have
> a validator attached to them.
>
> I have tried
>
> If Request.Params("mode") = "edit" then
>
> myValidator1.Visible = False
> myValidator1.Enabled = False
> myValidator1.IsValid = True
>
> End If
>
> and a combination of the three with no success, I still get the required
> field error message when submitting the form in edit mode
>
> Can anyone point me in the right direction please
>
> Many thanks
>
>
>Calvin Willman Guest
-
Paul Whitham TMM #3
Re: ASP.NET Required field validators
Assuming that you have separate buttons for the Add & Edit action then all
you need to do is add the attritute CauseValidation=False to the update
button.
--
Regards
Paul Whitham
Macromedia Certified Professional for Dreamweaver MX2004
Valleybiz Internet Design
[url]www.valleybiz.net[/url]
Team Macromedia Volunteer for Ultradev/Dreamweaver MX
[url]www.macromedia.com/support/forums/team_macromedia[/url]
"ossie" <ossie@microsoft.com> wrote in message
news:d3vs6h$qp8$1@forums.macromedia.com...if> Hi
>
> How can I stop a requiredfield validator from validating?
>
> The scenario is that my page has 2 modes "Add" & "Edit"
> I have a single form on the page that either populates from the databasethe> page is in edit mode or blank entries for adding a new record.
>
> When I am entering a new record I have 2 additional fields displayed onhave> form that are not required when editing the record, these 2 fields each> a validator attached to them.
>
> I have tried
>
> If Request.Params("mode") = "edit" then
>
> myValidator1.Visible = False
> myValidator1.Enabled = False
> myValidator1.IsValid = True
>
> End If
>
> and a combination of the three with no success, I still get the required
> field error message when submitting the form in edit mode
>
> Can anyone point me in the right direction please
>
> Many thanks
>
>
>
Paul Whitham TMM Guest
-
Kevin Marshall #4
Re: ASP.NET Required field validators
If i was you I would separate the Insert and Update into separate pages,
that way you would not have to wory about it.
--
Kevin Marshall
WebXeL.com Ltd
[url]http://www.webxel.com[/url]
ASP.NET Dreamweaver Extensions
[url]http://www.webxel-dw.co.uk[/url]
"ossie" <ossie@microsoft.com> wrote in message
news:d3vs6h$qp8$1@forums.macromedia.com...> Hi
>
> How can I stop a requiredfield validator from validating?
>
> The scenario is that my page has 2 modes "Add" & "Edit"
> I have a single form on the page that either populates from the database
> if page is in edit mode or blank entries for adding a new record.
>
> When I am entering a new record I have 2 additional fields displayed on
> the form that are not required when editing the record, these 2 fields
> each have a validator attached to them.
>
> I have tried
>
> If Request.Params("mode") = "edit" then
>
> myValidator1.Visible = False
> myValidator1.Enabled = False
> myValidator1.IsValid = True
>
> End If
>
> and a combination of the three with no success, I still get the required
> field error message when submitting the form in edit mode
>
> Can anyone point me in the right direction please
>
> Many thanks
>
>
>
Kevin Marshall Guest
-
Kevin Marshall #5
Re: ASP.NET Required field validators
Or you could add the following to the tags of the optional validators:
C#
Enabled='<%# Request.Params["mode"] != "edit" %>'
VB
Enabled='<%# Request.Params("mode") <> "edit" %>'
--
Kevin Marshall
WebXeL.com Ltd
[url]http://www.webxel.com[/url]
ASP.NET Dreamweaver Extensions
[url]http://www.webxel-dw.co.uk[/url]
"ossie" <ossie@microsoft.com> wrote in message
news:d3vs6h$qp8$1@forums.macromedia.com...> Hi
>
> How can I stop a requiredfield validator from validating?
>
> The scenario is that my page has 2 modes "Add" & "Edit"
> I have a single form on the page that either populates from the database
> if page is in edit mode or blank entries for adding a new record.
>
> When I am entering a new record I have 2 additional fields displayed on
> the form that are not required when editing the record, these 2 fields
> each have a validator attached to them.
>
> I have tried
>
> If Request.Params("mode") = "edit" then
>
> myValidator1.Visible = False
> myValidator1.Enabled = False
> myValidator1.IsValid = True
>
> End If
>
> and a combination of the three with no success, I still get the required
> field error message when submitting the form in edit mode
>
> Can anyone point me in the right direction please
>
> Many thanks
>
>
>
Kevin Marshall Guest



Reply With Quote

