I don't want to use buttons

Discussion in 'ASP General' started by Brent Webster, Aug 17, 2004.

  1. I have an asp page that is attached to database and I want to update
    the database when the window is closed.

    It is basically 5 text boxes wide by 8 text boxes high and these are
    all dynamically built by the database loading. I know exactly what
    textbox has what in it. I can do everything by submitting a form but
    I do not want a button to submit.

    Is there a way to when the window is closed run update code for a
    database.

    I can also open and close another page to do the update if need be.

    This is the code that I can use from the submit button. I load an
    array with all the values and can loop through these with the
    database.

    <FORM ACTION=:"array.asp" METHOD="get" id=frmName name=frmName>

    I can dynamically build the following which is currently produced by
    the submit button.

    array.asp?WeekFrom=8/12/2004&WeekTo=8/17/2004&tempid=2&line1text1=21&line1text2=&line1text3=&line1text4=&line1text5=55&cmdSubmit=Submit

    Any help stopping people from pushing my buttons would be greatly
    appreciated.

    Thanks,

    Brent
     
    Brent Webster, Aug 17, 2004
    #1
    1. Advertising

  2. You don't want to use etiquette

    Brent Webster wrote:
    > I have an asp page that is attached to database and I want
    > to update the database when the window is closed...


    Four copies of the same post in a 1-minute span is FOUR copies too many. If
    you are still trying to learn how to post, I suggest [microsoft.test].


    --
    Dave Anderson

    Unsolicited commercial email will be read at a cost of $500 per message. Use
    of this email address implies consent to these terms. Please do not contact
    me directly or ask me to contact you directly for assistance. If your
    question is worth asking, it's worth posting.
     
    Dave Anderson, Aug 17, 2004
    #2
    1. Advertising

  3. Brent Webster

    Jeff Cochran Guest

    On 17 Aug 2004 09:26:29 -0700, (Brent Webster)
    wrote:

    >I have an asp page that is attached to database and I want to update
    >the database when the window is closed.
    >
    >It is basically 5 text boxes wide by 8 text boxes high and these are
    >all dynamically built by the database loading. I know exactly what
    >textbox has what in it. I can do everything by submitting a form but
    >I do not want a button to submit.


    I can see why, you have a habit of hitting Submit buttons multiple
    times. Like when posting this message...

    >Is there a way to when the window is closed run update code for a
    >database.


    It's problematic. You can use a session end as a trigger, but it
    could take a while to time out. You could possibly write some
    Javascript to detect the window focus change. Maybe even an ActiveX
    control.

    The real issue is that ASP and HTML are not the same as writing a
    program. The browser requests something, the server sends it. Until
    the browser sends something back to the server, it's tough to know
    what the browser is doing.

    >I can also open and close another page to do the update if need be.


    You can do that but not use a Submit button? Kinda weird...

    >This is the code that I can use from the submit button. I load an
    >array with all the values and can loop through these with the
    >database.
    >
    ><FORM ACTION=:"array.asp" METHOD="get" id=frmName name=frmName>
    >
    >I can dynamically build the following which is currently produced by
    >the submit button.
    >
    >array.asp?WeekFrom=8/12/2004&WeekTo=8/17/2004&tempid=2&line1text1=21&line1text2=&line1text3=&line1text4=&line1text5=55&cmdSubmit=Submit
    >
    >Any help stopping people from pushing my buttons would be greatly
    >appreciated.


    Perhaps rethinking your button phobia is the real solution. What do
    you have against a Submit button on a form that makes this method
    unusable?

    Jeff
     
    Jeff Cochran, Aug 17, 2004
    #3
  4. Brent Webster

    dlbjr Guest

    Use the code below on the client to be called on the onchange event of any of the text boxes.
    Create the SaveChange.asp and use it to record the data on each change.

    function savedata(dblPositionID,dblValue) {
    document.body.style.cursor='wait';
    uniqueID++
    var XMLHTTP = new ActiveXObject( "Microsoft.XMLHTTP" );
    var URL = "SaveChange.asp?PID=" + dblPositionID + "&VALUE=" + dblValue + "&UCALLID=" + uniqueID
    XMLHTTP.open( "GET", URL, false );
    XMLHTTP.send();
    var result = XMLHTTP.responseText ;
    document.body.style.cursor='auto';
    }

    --
    dlbjr
    Pleading sagacious indoctrination!
     
    dlbjr, Aug 17, 2004
    #4
  5. Brent Webster

    Bã§TãRÐ Guest

    Bear in mind that ActiveX only works in IE, your solution could be done in Javascript

    check out http://www.experts-exchange.com/Web/Web_Languages/JavaScript/Q_20972905.html


    On Tue, 17 Aug 2004 15:44:26 -0500, "dlbjr" <> wrote:

    >Use the code below on the client to be called on the onchange event of any of the text boxes.
    >Create the SaveChange.asp and use it to record the data on each change.
    >
    >function savedata(dblPositionID,dblValue) {
    > document.body.style.cursor='wait';
    > uniqueID++
    > var XMLHTTP = new ActiveXObject( "Microsoft.XMLHTTP" );
    > var URL = "SaveChange.asp?PID=" + dblPositionID + "&VALUE=" + dblValue + "&UCALLID=" + uniqueID
    > XMLHTTP.open( "GET", URL, false );
    > XMLHTTP.send();
    > var result = XMLHTTP.responseText ;
    > document.body.style.cursor='auto';
    >}
     
    Bã§TãRÐ, Aug 18, 2004
    #5
  6. Sorry for the multiple posts, I used google groups and pressed submit
    button only once. Guess I will have to stop using google posting so I
    don't irritate the people that are helping me.

    Thanks,

    Brent Websterr
     
    Brent Webster, Aug 18, 2004
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. M
    Replies:
    2
    Views:
    417
    Ignacio Machin \( .NET/ C# MVP \)
    Oct 7, 2003
  2. TPS
    Replies:
    7
    Views:
    502
    Mark Rae
    Aug 8, 2004
  3. Roger
    Replies:
    1
    Views:
    648
    GreggTB
    May 20, 2005
  4. G Patel
    Replies:
    16
    Views:
    506
    Mark McIntyre
    Feb 17, 2005
  5. Brent Webster

    I don't want to use buttons

    Brent Webster, Aug 17, 2004, in forum: ASP General
    Replies:
    1
    Views:
    120
    Carol Carrot
    Aug 17, 2004
Loading...

Share This Page