|
POST
|
We need to verify addresses on a form. I want to use the geocoder widget to enter addresses using the autocomplete, but we do not want to allow the user to enter addresses into the textbox that are not in the list for the autocomplete. How can we do this? Also, I will need to verify multiple textboxes. I was thinking of a loop, but I haven't seen multiple address locators in any samples or applications developed by others. Can you have multiple address locators on one web page Kelly Hutchins? I was looking at this: Search | API Reference | ArcGIS API for JavaScript
... View more
07-16-2015
02:50 PM
|
0
|
2
|
3303
|
|
POST
|
It looks like it's working, but we have some test data that may have duplicates it, so I will need to work with that and clean it up. Thanks.
... View more
07-16-2015
01:53 PM
|
0
|
0
|
589
|
|
POST
|
I will be updating this today. I may have to change this Tim Witt. The textboxes weren't filling in the other way.
... View more
07-16-2015
07:47 AM
|
0
|
0
|
589
|
|
POST
|
I may tag you if I need help, but I won't be able to get to it until after the UC. Thanks.
... View more
07-16-2015
07:28 AM
|
0
|
2
|
1902
|
|
POST
|
Okay, I will give it a go and update my code tomorrow. One last thing. If I want to populate the form on load, should this block of code work before I start my loop as well since the variable ii has a value already?
... View more
07-15-2015
02:51 PM
|
0
|
3
|
589
|
|
POST
|
That's a tough one. That changes most of my application as I populate dropdowns and textboxes based on the current names. Are you sure this will work, because this is the only part of my application not working right now.
... View more
07-15-2015
02:26 PM
|
0
|
5
|
2058
|
|
POST
|
Then that gets a little tricky. I have a SUPPORTID in both forms. The reason for this is that there is a support ID for supports and there is a support ID for signs to identify which signs relate to the supports. Any idea on how to get around that?
... View more
07-15-2015
02:02 PM
|
0
|
7
|
2058
|
|
POST
|
So I take it I need to change all of my form ID's to caps to match the attributes. Is that correct, because it's not doing anything right now.
... View more
07-15-2015
01:50 PM
|
0
|
9
|
2058
|
|
POST
|
Here is my code: // Cycle through sign information with the previous button
// Changed name to correct button name
on(dom.byId("btnSignPrevious"), "click", function () {
console.log("Previous Works");
var query = new esriQuery();
var queryTask = new QueryTask(config.signLayerUrl);
query.returnGeometry = false;
query.outFields = ["*"];
query.where = "SUPPORTID = " + dom.byId("signSupportId").value;
queryTask.execute(query, function (results) {
ii--;
// Attempting to know how many signs are in my results
// Use gettArray.html to get array values
var resultItems = [];
var resultCount = results.features.length;
if (ii > -1) {
//console.log("Results start now!");
//console.log(results);
if (dom.byId("signSupportId").value == results.features[ii].attributes.SUPPORTID) {
ii--;
}
document.getElementById("signObjectId").value = results.features[ii].attributes.GLOBALID;
document.getElementById("mutcd").value = results.features[ii].attributes.MUTCD;
document.getElementById("installed").value = results.features[ii].attributes.INSTALLED;
document.getElementById("signId").value = results.features[ii].attributes.SIGNID;
document.getElementById("facing").value = results.features[ii].attributes.FACING;
document.getElementById("visibility").value = results.features[ii].attributes.VISIBILITY;
document.getElementById("condition").value = results.features[ii].attributes.CONDITION_;
//var featureAttributes = results.features[ii].attributes.GLOBALID;
//for (var attr in featureAttributes) {
// console.log("Attribute: " + featureAttributes);
//}
//var attachLoc = results.features[ii].attributes.ATTACHLOC;
//for (var attr in featureAttributes) {
// console.log("ATTACHLOC:" + attachLoc);
//}
//var attachNum = results.features[ii].attributes.ATTACHNUM;
//for (var attr in featureAttributes) {
// console.log("AttachNum:" + attachNum);
//}
} else {
console.log("This is where you will get the support information");
//document.getElementById("btnSupportNext").disabled = true;
}
})
}); and here is an excerpt from my form: <div class="modal-body">
<div class="form-group">
<label for="signObjectId">Object ID</label>
<input type="number" class="form-control" name="signObjectId" id="signObjectId" readonly>
</div>
<!-- Mutcd Begin -->
<div class="form-group">
<label for="mutcd">MUTCD</label>
<select id="mutcd" class="form-control" name="mutcd" required></select>
</div>
<!-- Mutcd End -->
<!-- - Begin -->
<div class="form-group">
<label for="installed">Installed</label>
<input type="date" class="form-control" name="installed" id="installed" />
</div>
<!-- Installed End -->
<!-- Sign ID Begin -->
<div class="form-group">
<label for="signId">Sign ID</label>
<input type="number" class="form-control" placeholder="Sign ID" name="signId" id="signId" />
</div>
<!-- Sign ID End -->
<!-- Facing Begin -->
<div class="form-group">
<label for="facing">Facing</label>
<input type="text" class="form-control" placeholder="Facing" name="facing" id="facing" />
</div>
<!-- Facing End -->
<!-- Visibility Begin -->
<div class="form-group">
<label for="visibility">Visibility</label>
<select id="visibility" class="form-control" name="visibility" required></select>
</div>
<!-- Visibility End -->
<!-- Condition Begin -->
<div class="form-group">
<label for="condition">Condition</label>
<select id="condition" class="form-control" name="condition" required></select>
</div>
<!-- Condition End -->
<!-- Support ID Begin -->
<div class="form-group">
<label for="signSupportId">Support ID</label>
<input type="number" class="form-control" name="signSupportId" id="signSupportId" />
</div>
<!-- Support ID End -->
<!-- Text Begin -->
<div class="form-group">
<label for="text">Text</label>
<input type="text" class="form-control" name="text" id="text" />
</div>
<!-- Text End -->
... View more
07-15-2015
01:25 PM
|
0
|
1
|
2058
|
|
POST
|
I am not sure I follow. When you have an element on the for that is GLOBALID and ATTACHLOC, how does the code know how to put which attribute where. They don't line up in the same order as on my form.
... View more
07-15-2015
12:57 PM
|
0
|
4
|
2347
|
|
POST
|
That helps clarify it. I do want to go through on at a time as I will be updating a form. Thanks.
... View more
07-15-2015
12:47 PM
|
0
|
6
|
2347
|
|
POST
|
I had to change one thing, but this simplified my code: console.log(results.features[ii].attributes.ATTACHLOC); My code is now(left the comments in for now): // Cycle through sign information with the previous button
// Changed name to correct button name
on(dom.byId("btnSignPrevious"), "click", function () {
console.log("Previous Works");
var query = new esriQuery();
var queryTask = new QueryTask(config.signLayerUrl);
query.returnGeometry = false;
query.outFields = ["*"];
query.where = "SUPPORTID = " + dom.byId("signSupportId").value;
queryTask.execute(query, function (results) {
ii--;
// Attempting to know how many signs are in my results
// Use gettArray.html to get array values
var resultItems = [];
var resultCount = results.features.length;
if (ii > -1) {
console.log("Results start now!");
console.log(results);
console.log(results.features[ii].attributes.ATTACHNUM);
console.log(results.features[ii].attributes.ATTACHLOC);
console.log(results.features[ii].attributes.GLOBALID);
//var featureAttributes = results.features[ii].attributes.GLOBALID;
//for (var attr in featureAttributes) {
// console.log("Attribute: " + featureAttributes);
//}
//var attachLoc = results.features[ii].attributes.ATTACHLOC;
//for (var attr in featureAttributes) {
// console.log("ATTACHLOC:" + attachLoc);
//}
//var attachNum = results.features[ii].attributes.ATTACHNUM;
//for (var attr in featureAttributes) {
// console.log("AttachNum:" + attachNum);
//}
} else {
console.log("This is where you will get the support information");
//document.getElementById("btnSupportNext").disabled = true;
}
})
});
... View more
07-15-2015
12:34 PM
|
1
|
0
|
2347
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 02-26-2015 12:31 PM | |
| 1 | 06-24-2015 06:06 AM | |
| 1 | 07-15-2015 12:34 PM | |
| 1 | 05-21-2015 02:27 PM | |
| 1 | 05-19-2015 11:52 AM |
| Online Status |
Offline
|
| Date Last Visited |
11-11-2020
02:23 AM
|