ASP and JavaScript newbie question

Discussion in 'ASP General' started by Mark B, Jan 24, 2006.

  1. Mark B

    Mark B Guest

    Hi all,

    I'm the IT Support guy for a school. They run a resource booking Access
    database that the manager would like to convert to a web page.

    I have nearly done so, using pure ASP to draw the web page, retrieve the
    bookings info from an SQL database. It looks quite nice, and thus far, works
    pretty well!

    I have come completely unstuck when using the "OnChange" event for all the
    textboxes that display the current bookings, or lack of a booking, for a
    day/session.

    I have inserted |onChange=txtOnChange(this.value,this.name," & chr(34) &
    Rsrce & chr(34) & "," & chr(34) & mnth & chr(34) & ")| (ignore the pipes -
    they're for readability only) which calls a client side JavaScript function
    (receiving four variables) to update the database.

    This script works fine except for the fact that IE or whatever browser warns
    "the web site may not be trusted. Continue?" when attempting (in the
    Javascript function) to connect to the SQL database and update the record.

    Since I cannot change the security settings for every person's browser, and
    I have to use a client side JavaScript function to update the database, is
    it possible to merely have the JavaScript function call a server side .ASP
    file and update the record that way?

    Something like:-

    <SCRIPT TYPE="text/javascript">
    <!--
    function txtOnChange(txtNewValue,txtID,Resource,txtMonth)
    {
    <a
    href=http://myserver/updaterecord.asp?w=txtNewValue&x=txtID&y=Resource&z=txtMonth
    </a>
    }
    </SCRIPT>

    Since I'm pretty new to ASP, and even newer to JavaScript, what is the
    correct way to launch an ASP fille (with variables) from within a JavaScript
    function? Can it in fact be done? (especially with the browser not warning
    the viewer of security issues?)

    Be kind...

    Thanks,

    Mark
    Mark B, Jan 24, 2006
    #1
    1. Advertising

  2. Mark B

    dNagel Guest

    Mark B wrote:
    > Hi all,
    >
    > I'm the IT Support guy for a school. They run a resource booking Access
    > database that the manager would like to convert to a web page.
    >
    > I have nearly done so, using pure ASP to draw the web page, retrieve the
    > bookings info from an SQL database. It looks quite nice, and thus far, works
    > pretty well!
    >
    > I have come completely unstuck when using the "OnChange" event for all the
    > textboxes that display the current bookings, or lack of a booking, for a
    > day/session.
    >
    > I have inserted |onChange=txtOnChange(this.value,this.name," & chr(34) &
    > Rsrce & chr(34) & "," & chr(34) & mnth & chr(34) & ")| (ignore the pipes -
    > they're for readability only) which calls a client side JavaScript function
    > (receiving four variables) to update the database.
    >
    > This script works fine except for the fact that IE or whatever browser warns
    > "the web site may not be trusted. Continue?" when attempting (in the
    > Javascript function) to connect to the SQL database and update the record.
    >
    > Since I cannot change the security settings for every person's browser, and
    > I have to use a client side JavaScript function to update the database, is
    > it possible to merely have the JavaScript function call a server side .ASP
    > file and update the record that way?
    >
    > Something like:-
    >
    > <SCRIPT TYPE="text/javascript">
    > <!--
    > function txtOnChange(txtNewValue,txtID,Resource,txtMonth)
    > {
    > <a
    > href=http://myserver/updaterecord.asp?w=txtNewValue&x=txtID&y=Resource&z=txtMonth
    > </a>
    > }
    > </SCRIPT>
    >
    > Since I'm pretty new to ASP, and even newer to JavaScript, what is the
    > correct way to launch an ASP fille (with variables) from within a JavaScript
    > function? Can it in fact be done? (especially with the browser not warning
    > the viewer of security issues?)
    >
    > Be kind...
    >
    > Thanks,
    >
    > Mark
    >
    >
    dNagel, Jan 24, 2006
    #2
    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. Eric Smith
    Replies:
    0
    Views:
    274
    Eric Smith
    Oct 21, 2003
  2. Bob [BVP]
    Replies:
    5
    Views:
    755
    Bob [BVP]
    Aug 9, 2004
  3. Jerry C.
    Replies:
    8
    Views:
    206
    Uri Guttman
    Nov 23, 2003
  4. Kruno Saho
    Replies:
    0
    Views:
    125
    Kruno Saho
    Apr 7, 2013
  5. Dave Angel
    Replies:
    0
    Views:
    110
    Dave Angel
    Apr 7, 2013
Loading...

Share This Page