Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > ASP and JavaScript newbie question

Reply
Thread Tools

ASP and JavaScript newbie question

 
 
Mark B
Guest
Posts: n/a
 
      01-24-2006
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


 
Reply With Quote
 
 
 
 
dNagel
Guest
Posts: n/a
 
      01-24-2006


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
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Newbie question: migrating "global variables" from ASP to ASP.NET =?Utf-8?B?QW5kcmVhcyBIb2ZtYW5u?= ASP .Net 2 04-18-2005 01:53 PM
Newbie Question: Asp Classic and ASP.NET running on IIS5 side-by-side ? Bob [BVP] ASP .Net 5 08-09-2004 01:55 PM
newbie: cisco vlan newbie question No Spam Cisco 3 06-07-2004 10:02 AM
dumb newbie question (or newbie dumb question) Jerry C. Perl Misc 8 11-23-2003 04:11 AM
Newbie question on ASP and DB and forms... Eric Smith ASP .Net 0 10-21-2003 01:29 PM



Advertisments