set required attribute depanding on selected dropdown item

Last post 07-07-2009 5:33 AM by sjnaughton. 3 replies.

Sort Posts:

  • set required attribute depanding on selected dropdown item

    07-02-2009, 9:56 AM
    • Member
      46 point Member
    • orimaspnet
    • Member since 06-04-2008, 9:07 AM
    • Posts 94

    hi,

    in my insert.aspx.
    when i select Type e.g. "external"  (Type is Column in DB)
    Domain is required Field when Type="internal" domain is not required.

    How can i do it onchanging or onchanged event


    Thanks


  • Re: set required attribute depanding on selected dropdown item

    07-02-2009, 5:13 PM
    • Star
      12,250 point Star
    • sjnaughton
    • Member since 04-29-2008, 1:11 PM
    • Newton-le-Willows, Merseyside, UK
    • Posts 2,558
    • TrustedFriends-MVPs

     Hi Orimaspnet, I'm not sure what you are trying to do? It may be better is you describe what you want to achive.

    Steve Big Smile

    Always seeking an elegant solution.
    [Oh! If olny I colud tpye!]
    c# Bits blog
    Oh, and don't forget to mark as answer any posts that help you Big Smile
    Filed under:
  • Re: set required attribute depanding on selected dropdown item

    07-06-2009, 2:37 PM
    • Member
      46 point Member
    • orimaspnet
    • Member since 06-04-2008, 9:07 AM
    • Posts 94

    ok.
    - Insert.aspx
    - There i have a dynamiccontrol (e.g. Type) which is a dropdownlist UIHint from FieldTemplates
    with listitems "internal" and "external"
    - an other dynmiccontrol have (e.g. Account)
    - on selecting Type= "internal" the Account is not requiered Field
    and on selecting "external" the user must specify an Account so the Field is required
    - i tried it in the table class with <Required> Attribute - in the event "OnTypeChanging" but i can not access the value of the "Type" which is a dynamiccontrol
    Thanks

  • Re: set required attribute depanding on selected dropdown item

    07-07-2009, 5:33 AM
    • Star
      12,250 point Star
    • sjnaughton
    • Member since 04-29-2008, 1:11 PM
    • Newton-le-Willows, Merseyside, UK
    • Posts 2,558
    • TrustedFriends-MVPs

     Ah! I have a sample wich does somthing like this, Communicating Between FieldTemplates in Dynamic Data... this sample has fields depending upon a checkbox if checked the show if not they hide, should be easy to modify for your use.

    Steve Big Smile

    Always seeking an elegant solution.
    [Oh! If olny I colud tpye!]
    c# Bits blog
    Oh, and don't forget to mark as answer any posts that help you Big Smile
    Filed under:
Page 1 of 1 (4 items)