Gridview textbox has data check without postback.. javascript?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • wildman@noclient.net

    Gridview textbox has data check without postback.. javascript?

    RE: Gridview textbox has data check without postback.. javascript?

    I have a gridview with a textbox. I can set the textbox to
    autopostback and check for a value in a prerender event to decide if I
    should make a button on the grid row visible. However, the problem
    with autopostback on a textbox is the postback occurrs when you select
    another control or click away ( I guess). This is very awkward when
    the control selected is dropdown as the page/selected control apears
    to flicker and show and then retract the dropdownlist.

    What's the best way to attack this? .. I want a button on my gridview
    row to be visible when both a textbox and dropdown on the control
    have data selected/entered. problem is, I don't want to turn
    autopostback on the textbox since it behalves awkwardly when the next
    control selected is a dropdown and that cause a postback before I can
    even select a value.

    Thanks in advance for any help or information.
  • =?Utf-8?B?QW5nZWw=?=

    #2
    RE: Gridview textbox has data check without postback.. javascript?

    Suggest you post a code sample
    --
    aaa


    "wildman@noclie nt.net" wrote:
    RE: Gridview textbox has data check without postback.. javascript?
    >
    I have a gridview with a textbox. I can set the textbox to
    autopostback and check for a value in a prerender event to decide if I
    should make a button on the grid row visible. However, the problem
    with autopostback on a textbox is the postback occurrs when you select
    another control or click away ( I guess). This is very awkward when
    the control selected is dropdown as the page/selected control apears
    to flicker and show and then retract the dropdownlist.
    >
    What's the best way to attack this? .. I want a button on my gridview
    row to be visible when both a textbox and dropdown on the control
    have data selected/entered. problem is, I don't want to turn
    autopostback on the textbox since it behalves awkwardly when the next
    control selected is a dropdown and that cause a postback before I can
    even select a value.
    >
    Thanks in advance for any help or information.
    >

    Comment

    • bruce barker

      #3
      Re: Gridview textbox has data check without postback.. javascript?

      you should always render the button but hide with style="display: none",
      then in javascript via a onchange handler, check the value, then set the
      style to block.

      if you are going to do .net development, you should learn the w3c dom
      and javascript. posting back to tweek the UI is very bad coding. some
      will suggest using an update panel, but that is way overkill for this
      and would be slow over the internet.

      -- bruce (sqlwork.com)

      wildman@noclien t.net wrote:
      RE: Gridview textbox has data check without postback.. javascript?
      >
      I have a gridview with a textbox. I can set the textbox to
      autopostback and check for a value in a prerender event to decide if I
      should make a button on the grid row visible. However, the problem
      with autopostback on a textbox is the postback occurrs when you select
      another control or click away ( I guess). This is very awkward when
      the control selected is dropdown as the page/selected control apears
      to flicker and show and then retract the dropdownlist.
      >
      What's the best way to attack this? .. I want a button on my gridview
      row to be visible when both a textbox and dropdown on the control
      have data selected/entered. problem is, I don't want to turn
      autopostback on the textbox since it behalves awkwardly when the next
      control selected is a dropdown and that cause a postback before I can
      even select a value.
      >
      Thanks in advance for any help or information.

      Comment

      Working...