Search widget as part of HTML form.

250
1
05-07-2021 03:43 AM
LouisCoetzee
New Contributor

Good day,

 

Could someone please assist / advise on how I could use the autocomplete search widget as part of a HTML form, in order to store the output result in a name attribute / value (please see example below)?

 

 

<form action= "/search" method="POST"> 

   <div id="searchDiv" name="location" placeholder="Search by city"></div>        
   
   <button type="submit">Search</button>
</form>
       
  

 

 

I am currently using the below search widget:

https://codepen.io/noash/pen/yLgmRWK?editors=1000

 

 

 

 

 

 

 

0 Kudos
1 Reply
Noah-Sager
Esri Regular Contributor

You might have more luck using the SearchViewModel for this workflow: https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.ht...

 

0 Kudos