如果值小于-5,则弹出

I have a database with a table called "quote". It stores a margin field which is updated by users using an ajax table. This is in "process2.php" file.

I want a pop-up message saying "are you sure you want to put this margin" when the user clicks on the submit button if a margin value is below 5".

This is my submit form.

<form action="process3.php" method="POST" enctype="multipart/form-data">
<input type="submit" name="submit" value="Generate Quote"/>
</form>

You could do this with JavaScript (and jQuery, in this example). Your form would need an ID, as below:

<form action="process3.php" method="POST" id="myForm">
<input type="text" name="checkMargin1" />
<input type="text" name="checkMargin2" />
<input type="submit" value="Send" />
</form>

And then this would go into the head of your document:

<script type="text/javascript">
$('#myForm').onSubmit(function() {
    var check1 = $('input[name="checkMargin1"]').val();
    var check2 = $('input[name="checkMargin2"]').val();
    if (check1 <= 5 || check2 <= -5) {
        var answer = confirm("Are you sure you want to submit?");
        return answer;
    } else {
        return true;
    }
});
</script>

That function is fired when your form is submitted. It gets the values of the two margin fields (adding more should be easy) and checks if they are over -5. If they are, then return true allows the form to submit. If they are not, then a prompt dialog asks the user, which returns true when they click "Okay" and false when they click "Cancel", thus allowing or stopping the form from being sent.

Hope this helps :)