How Change The Link Form Action A Accordance With The ``? September 23, 2022 Post a Comment This form is search form. when I click the 'alfamart' or 'bca', I want the link change. like this, link: /en2/maps(alfamart)or(bca)/ in accordance with the Solution 1: You don't need to get value from URL, you can change form action by select box value. Baca JugaPrevent Form From Posting Until Javascript Code Is SatisfiedCheck All/uncheck All In Foreach LoopWhen Should I Return True/false To Ajax And When Should I Echo "true"/"false" $('.selectpicker').change(function(){ if($(this).val() == 'alfamart'){ $('form').attr('action','alfamart.html'); alert('action is alfamart.html'); } else { $('form').attr('action','BCA.html'); alert('action is BCA.html'); } });Copy <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <form action="/en2/maps"> Distination: <select name="textSearchTerms" class="selectpicker" data-live-search="true"> <option value="alfamart">Alfamart</option> <option value="BCA">BCA</option> </select> <input type="submit" value="Search"> </form>Copy Share You may like these posts Jquery With Several Elements IssueChange The Background Color And Text Color With A Timer With JavascriptHow To Use Greasemonkey To Remove A Href BlockHow To Set Opacity Of An Image Opacity At The Time Of Upload? Post a Comment for "How Change The Link Form Action A Accordance With The ``?"
Post a Comment for "How Change The Link Form Action A Accordance With The `