Solved

Run asp script with on change of input field

Posted on 2014-07-29
6
349 Views
Last Modified: 2014-08-03
I have a form with a checkbox. I need to run an asp script when it is changed (checked/unchecked)

I am sure I have to use an onChange() JavaScript function but I have no clue as to how to run the asp code.

Any ideas
0
Comment
Question by:robrodp
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 58

Assisted Solution

by:Gary
Gary earned 250 total points
ID: 40227171
ASP doesn't run in the browser, you can use ajax to execute a ASP on the server
What is supposed to happen when the checkbox is changed?
0
 

Assisted Solution

by:robrodp
robrodp earned 0 total points
ID: 40227179
The checkbox is stored in a field in an ms sql table. If clicked change it to on or off as is the case.

I I can get the on change to run the script even if it runs it on the server (as if it was the action in the form) I will be fine,
0
 

Author Comment

by:robrodp
ID: 40227182
It doesnt matter ifit reloads the page
0
Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

 
LVL 33

Accepted Solution

by:
Big Monty earned 250 total points
ID: 40227188
you're correct, you would use the onchange() event in javascript. as Gary pointed out, you need to use ajax, or you can submit the form and use POST/GET to get your data to run your asp script (you're not referring to running a vbs file are you?)

you can use this as an example:

your html:
<input type="checkbox" name="chk1" value="1" onchange="document.formName.submit()" />

Open in new window


your server side code:
<%
if Request.Form("chk1") = "1" then        '-- assuming POST here
     '-- run your asp script
end if
%>

Open in new window

0
 
LVL 33

Expert Comment

by:Big Monty
ID: 40227200
just a heads up, you can just click on the "Split Points" links under each answer you want to accept.
0
 

Author Closing Comment

by:robrodp
ID: 40237109
That got me going...

Thz
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Use these top 10 tips to master the art of email signature design. Create an email signature design that will easily wow recipients, promote your brand and highlight your professionalism.
This article discusses four methods for overlaying images in a container on a web page
In this tutorial viewers will learn how to position overlapping items using z-index in CSS. They will also learn the restrictions on the z-index property.  Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Red.…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

697 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question