PDA

View Full Version : New enquiry script



biomike
12-10-2008, 05:03 PM
I want to add a script on to my website that enables new enquires to submit an enquiry.

i'v set up the forms but need to some help in implementing.

this is the page i have set up http://www.bioenergyhealing.org.uk/ask_a_question

thanks

michael

Schmoopy
12-10-2008, 05:04 PM
This isn't something you can do with JavaScript, you need a server side language such as PHP to process the form.

You can however do validation with JavaScript which is always useful.

biomike
12-10-2008, 05:05 PM
thanks, i v just listed my thread in php

Schmoopy
12-10-2008, 05:10 PM
If you do want some validation methods anyway you could do something like this to the onclick event:



<head>
<script type="text/javascript">
<!--
function checkForm()
{
if (getElementById('T1').value == "")
{
alert("Please input your name");
return false;
}

}
-->
</script>
</head>

<body>
First Name: <input type="text" name="T1" id="T1" size="29">

<input type"button" name="Submit" id="Submit" onclick="checkForm();" value="Send Email">
</body>



Something like that to save some time for PHP by not sending a form with nothing on it.