JavaScript validation of a DataList

Ask a Question related to ASP.NET General, Design and Development.

  1. #1

    Default JavaScript validation of a DataList

    Hello all,

    I have a DataList control displaying data from the database (some products).
    There are also TexBox controls and ImageButton controls in the two columns
    of the DataGrid. I would like to implement client-side validation so that
    when user clicks ImageButton (with add to basket function), JavaScript
    checks if the correct string was entered in the aforementioned TextBox. All
    this is usual and the JavaScript in itself is not a problem of course, but
    how do I wire those ImageButton controls (in fact their OnClick events) to
    JavaScript and how do I pass the value from TextBox control (DataList child
    control) to JScript?

    Many thanks,
    Hrvoje


    Hrvoje Vrbanc Guest

  2. Similar Questions and Discussions

    1. Newbie:Is Javascript validation really the best way to go?
      Hello to all, I remember reading somewhere that JavaScript validation is superior to CF validation and not to even use CF for that. Is this...
    2. Javascript Validation Problem
      Hi, I am validating a form, by looping through each element, its not working though, can anybody help? Here is the page: ...
    3. Referencing a TextBox control in Javascript from DataList ItemTemplate
      I have a calendar control which pops up as a new window when i click on my textbox. The calendar control returns a Javascript function whereby...
    4. Javascript Validation
      C wrote: This can be done with client-side code using the onkeypress event. Please follow-up in a javascript dhtml newsgroup since this question...
    5. datalist edit mode and javascript pop up calendar
      Hi Check whether textbox control name is 'txtDischargeDate' or it contains automatically generated id? HTH Ravikanth return the selected
  3. #2

    Default Re: JavaScript validation of a DataList

    You can use something like 'this.nextSibling.value', if the textbox is
    rendered right after your button.

    "Hrvoje Vrbanc" <hrvojev@recro.hr> wrote in message
    news:O8c49%23LXDHA.208@tk2msftngp13.phx.gbl...
    > Hello all,
    >
    > I have a DataList control displaying data from the database (some
    products).
    > There are also TexBox controls and ImageButton controls in the two columns
    > of the DataGrid. I would like to implement client-side validation so that
    > when user clicks ImageButton (with add to basket function), JavaScript
    > checks if the correct string was entered in the aforementioned TextBox.
    All
    > this is usual and the JavaScript in itself is not a problem of course, but
    > how do I wire those ImageButton controls (in fact their OnClick events) to
    > JavaScript and how do I pass the value from TextBox control (DataList
    child
    > control) to JScript?
    >
    > Many thanks,
    > Hrvoje
    >
    >

    Marina Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139