Hello,
How to call a function on form submission.

Thanks

Recommended Answers

All 2 Replies

with javascript, the the function should be written in the head tags.after this you can write your php script and in the body tag include the code
example <body onsubmit="show_warning()"> in this case the show_warning() is a java script functional name, it should be written like this <head> <script type = "text/javascript">
function show_warning()
{
code
}
</script>
</head>

Member Avatar for diafol

You could put the handler into the form's action attribute. Body is a bit much maybe.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.