Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Calling a Server Side function from an onclick event?

Status
Not open for further replies.

princessk1

Programmer
Feb 28, 2002
74
CA
Is it possible to call a server side function in an onclick event for a submit button? If I put the function between <script> tags, it will go into the function, but it won't if the function is between <% %> tags?

This is part of the code that calls the function:

<input type = &quot;Submit&quot; value = &quot;Save Sales Amount&quot; onclick = SaveSales>

where SaveSales is the name of the function.

Thanks in advance.
 
I'm pretty sure that won't work because the onclick is client side and the function server side.

Mark
 
There are two ways I know of to get a server side process to execute from a client's machine. There are Microsoft tools (XMLHttp) that became available with MDAC 2.5. Of course, that would require the client to have them installed. Not easy to have happen.

The easiest method is to use a form and submit the page, then you redirect back to the page with the new data processed.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top