I have been a little busy over the past few days. Today I have studied the method of using select form values for operations. I feel that the JS version is not a new thing, but I haven't seen anyone in the PHP version, so we can write it out together and remove the grass by the way. I wrote it while eating. After I finished writing it, I went out. I have no time to read comments one by one recently. I have to wait for my status.
I have been a little busy over the past few days. Today I have studied the method of using select form values for operations. I feel that the JS version is not a new thing, but I haven't seen anyone in the PHP version, so we can write it out together and remove the grass by the way. I wrote it while eating. After I finished writing it, I went out. I have no time to read comments one by one recently. I have to wait for my status.
I have been a little busy over the past few days. Today I have studied the method of using select form values for operations. I feel that the JS version is not a new thing, but I haven't seen anyone in the PHP version, so we can write it out together and remove the grass by the way.
I wrote it while eating. After I finished writing it, I went out. I have no time to read comments one by one recently, I have to wait until I get better.
I hope you miss me so deeply.
PHP Method
PHP needs to pass$ _ POST
Obtain the value passed by the form submission. Therefore, you must click the button to submit the value before performing the operation,
The effect is as follows:
JS Method
The JS method does not need to refresh the page and displays the results in real time.
Script function getResult () {var number = document. formJs. xhdSelect. value; // obtain the select value document. getElementById ("result "). innerHTML = number * 2; // rewrite the element to display the operation result} script
The effect is as follows:
Original article address: Two Methods of Selcect form value calculation, thanks to the original author for sharing.