How to pass form values to a url


#1

Am about to fetch JSON values which returns different values for different url. Which means I want to get values from input fields and pass the value to url like.
http://something.com/available.php?origin="{{origin}}"&destination="{{destination}}"&depart_date="{{date}}""

Is this possible to add values in URL ?


#2

Hey @dilipwk: I actually wrote a tutorial that goes step by step in explaining how to POST data from an Ionic app to a PHP server: http://www.nikola-breznjak.com/blog/codeproject/posting-data-from-ionic-app-to-php-server/

Please let me know if this will help. The code is also on Github: https://github.com/Hitman666/IonicServerSave


#3

Hi Hitma,

My question is not about passing values to php. It’s about generating dynamic url depending on user input.


#4

Did you actually read the tutorial or you just saw the title and concluded it’s not what you need?


#5

This is not an Ionic question, it’s even slightly related to angularJS, it’s a pure javascript question that you’ll easily find on Google or stackoverflow.


#6
 <div >     
 <select ng-model="origin" ng-options="cities as cities.name for cities in cities" >

Selected value: {{origin.name}}

Way to get value of select options.