1

I am using the ArcGIS API for JavaScript to build a web application. Within the web app a geoprocessing service is executed which requires an input that is user dependent.

I thought of a text box where the user can enter a value, which should then be read by the application and used for the geoprocessing service.

How can this be done? I searched on the ArcGIS API website and in the Internet, but I could not find any solution so far.

PolyGeo
65.5k29 gold badges115 silver badges349 bronze badges
asked Dec 11, 2015 at 15:56

1 Answer 1

4

You can do this easily with some HTML by using a text box somewhere in your page or in a modal window:

<input type="text" id="out-folder">

And then for the params of your GP Service in JavaScript:

// set up params
var gpParams = {
 "Boundary": fs,
 "Layer_URL": dom.byId("layer-choice").value,
 "Output_Folder_Name": dom.byId("out-folder").value, //var from text box is here
 "Include_Features": dom.byId("include-features").checked
}

In my example, I'm using the dojo.dom to get the textbox value, but you can also do this with standard JavaScript like this:

document.getElementById("out-folder").value

I have some very basic examples of using GP services with the JavaScript API here.

answered Dec 11, 2015 at 16:22
1
  • Thank you for the answer. It should have been accepted. The presentation is really nice! Commented Nov 26, 2017 at 14:05

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.