After a button is added to the submit table, the system automatically submits the problem. I want to add a button to the table. when a button is pressed, the system only needs to obtain the position and enter it. do not submit the button. However, after I put the button in the table, the table will be automatically submitted after the button is pressed. What should I do before I press the button and do not submit it?
This is to call the jssdk location interface to obtain the location.
Wx. ready (function () {document. querySelector ('# getlocation '). onclick = function () {wx. getLocation ({type: 'gcj02', success: function (res) {// alert (JSON. stringify (res); var lat = res. latitude; var lng = res. longpolling; var latLng = new qq. maps. latLng (lat, lng); geocoder = new qq. maps. geocoder ({complete: function (result) {signin_info = result. detail. addressComponents. province + result. detail. addressComponents. city + result. detail. addressComponents. district + result. detail. addressComponents. street; $ ("# address "). val (signin_info) ;}}) geocoder. getAddress (latLng) ;}, cancel: function (res) {alert ('User denied authorization to obtain geographic location ');}});};
Reply to discussion (solution)
Click where I won't submit
Click where I won't submit
I write it like this, click where I am, and then the whole table is submitted. Will it be related to the if (IS_POST) written in the background?
When I click where I am, I just want to run the following js code.
Did you click it wrong?
I won't submit it when I click where.
Or are you?
Click submit?
Did you click it wrong?
I won't submit it when I click where.
Or are you?
Click submit?
After I click it, I will get the address and submit it. Will it be related to the if (IS_POST) written in the background?
Where am I?
Click this button. Key points are submitted.
Button comes with type = "submit", so it will be submitted
Adding a type = "button" won't be submitted.
Or directly change it
If you set the type to button, it will not be submitted.