Jump to content
SingaporeBikes.com Telegram Now LIVE! Join NOW for the Last Reviews, News, Promotions & Offers in Singapore! ×
  • Join SingaporeBikes.com today! Where Singapore Bikers Unite!

    Thank you for visiting SingaporeBikes.com - the largest website in Singapore dedicated to all things related to motorcycles and biking in general.

    Join us today as a member to enjoy all the features of the website for FREE such as:

    Registering is free and takes less than 30 seconds! Join us today to share information, discuss about your modifications, and ask questions about your bike in general.

    Thank you for being a part of SingaporeBikes.com!

Recommended Posts

Posted

Anyone know how to create a submit form?

 

I need a form that allows people to key in their name and email and submit to me so that i can receive it. but i understand that i require my server to be available as i need to use php?

 

anyone to enlighten me?

  • Replies 14
  • Created
  • Last Reply

Top Posters In This Topic

Posted

i did this for one of my project using php... you can use it as a reference

 

<?php

require_once("config.php");

require_once("header.php");

require_once("left.php");

?>

 

<script language=javascript src="js/validate.js">

<script LANGUAGE="JavaScript">

<!-- Begin

 

function checkfrmRegisterFields() {

blank = "";

if (document.frmRegister.sUsername.value == "") {

blank += "\n - Username is a required field";

}

if (document.frmRegister.sPassword.value == "") {

blank += "\n - Password is a required field";

}

if (document.frmRegister.sPasswordAgain.value == "") {

blank += "\n - Password Again is a required field";

}

if (document.frmRegister.sPassword.value != document.frmRegister.sPasswordAgain.value) {

blank += "\n - New Password does not tally with New Password Again";

}

if (document.frmRegister.sName.value == "") {

blank += "\n - Name is a required field";

}

if (document.frmRegister.sAddress.value == "") {

blank += "\n - Address is a required field";

}

if (document.frmRegister.sPostalCode.value == "") {

blank += "\n - Postal Code is a required field";

}

if ((document.frmRegister.sEmail.value == "") ||

(document.frmRegister.sEmail.value.indexOf('@') == -1) ||

(document.frmRegister.sEmail.value.indexOf('.') == -1)) {

blank += "\n - Email is a required field";

}

if (document.frmRegister.sContact.value == "") {

blank += "\n - Contact is a required field";

}

if (!document.frmRegister.sAgree.checked) {

blank += "\n - You must accept the Terms & Conditions to be able to register";

}

 

if (blank != "") {

blank = "You failed to correctly fill in your:\n" + blank + "\n\nPlease re-enter and submit again.\n";

alert(blank);

return false;

}

else {

return true;

}

}

 

//-->










images/regbanner.png








































Fill in the fields below to register...

Username:
Password:
Password again:
Name:
Address:
Postal Code:
Email:
Contact:
I agree with all the Terms & Conditions.

 

<?php

require_once("footer.php");

?>

Posted

for php, do i need to have a hosting server before i can use the php format?

 

BUT THE WAY...is the first code you give me place in the head and the next in the body or both are of different script?:cheeky:

Posted
Originally posted by ET@Oct 6 2006, 10:21 AM

for php, do i need to have a hosting server before i can use the php format?

 

BUT THE WAY...is the first code you give me place in the head and the next in the body or both are of different script?:cheeky:

To utilize PHP, you need a PHP Server.

 

To utilize PHP to display webpages on the internet, you need a web hosting company that offers PHP web hosting.

 

myusha, I don't think your form enables him to have e-mails sent to him by visitors who visit his site (and thus, his e-mail form). I only see the functionality of validation: where the page only checks to see whether the user fill in the form correctly...but I don't see the e-mail sending functionality.

 

You need to have a complex POP or IMAP server [application that enables you to send e-mails such as [email protected]] running alongside your PHP server. Moreover, you need to code the PHP form page to send the filled-in form as well, more coding logic and quite leceh IMO...

 

There is actually a JavaScript way to implement the e-mail functionality...except that it'll automatically launch Outlook Express when you press Send. Not streamlined IMO.

Co-Moderator for IT -inerary forum

Biker nerd • Windows • Apple Mac • Android user

 

"Kick up your sidestand bro, let's ride..."

Posted

Here's a no-frills JavaScript code to prepare an e-mail to be sent:

(P.S.: The <script> block can be placed either within

or . Rule-of-execution-flow still applies; the <script> block has to come first, then the block )

 

----------

 

<script language="javascript">

function crunchThis()

{

var theEmail = document.theQuestions.enteredEmail.value

var theSubject = document.theQuestions.enteredSubject.value

var theMessage = document.theQuestions.enteredMessage.value

 

self.location="mailto:" +theEmail+ "?subject=" +theSubject+ "&body=" +theMessage;

}

 

 

<!-- the onSubmit="" attribute is optional. It is an added functionality used if you have a lot of keyboard-savvy users that utilize the ENTER key to submit the message instead of clicking buttons to submit. -->

E-mail

 

 

Subject

 

 

Message

 

 

Co-Moderator for IT -inerary forum

Biker nerd • Windows • Apple Mac • Android user

 

"Kick up your sidestand bro, let's ride..."

Posted
Originally posted by redbeacon@Oct 9 2006, 01:13 AM

Here's a no-frills JavaScript code to prepare an e-mail to be sent:

(P.S.: The <script> block can be placed either within

or . Rule-of-execution-flow still applies; the <script> block has to come first, then the
block )

 

----------

 

<script language="javascript">

function crunchThis()

{

var theEmail = document.theQuestions.enteredEmail.value

var theSubject = document.theQuestions.enteredSubject.value

var theMessage = document.theQuestions.enteredMessage.value

 

self.location="mailto:" +theEmail+ "?subject=" +theSubject+ "&body=" +theMessage;

}

 

 

<!-- the onSubmit="" attribute is optional. It is an added functionality used if you have a lot of keyboard-savvy users that utilize the ENTER key to submit the message instead of clicking buttons to submit. -->

E-mail

 

 

Subject

 

 

Message

 

 

where do i input the email(which i have) to where i want them to sent to?

Posted
Originally posted by redbeacon@Oct 9 2006, 01:13 AM

Here's a no-frills JavaScript code to prepare an e-mail to be sent:

(P.S.: The <script> block can be placed either within

or . Rule-of-execution-flow still applies; the <script> block has to come first, then the
block )

 

----------

 

<script language="javascript">

function crunchThis()

{

var theEmail = document.theQuestions.enteredEmail.value

var theSubject = document.theQuestions.enteredSubject.value

var theMessage = document.theQuestions.enteredMessage.value

 

self.location="mailto:" +theEmail+ "?subject=" +theSubject+ "&body=" +theMessage;

}

 

 

<!-- the onSubmit="" attribute is optional. It is an added functionality used if you have a lot of keyboard-savvy users that utilize the ENTER key to submit the message instead of clicking buttons to submit. -->

E-mail

 

 

Subject

 

 

Message

 

 

where do i input the email(which i have) to where i want them to sent to?

Posted
Originally posted by ET@Oct 10 2006, 08:20 PM

where do i input the email(which i have) to where i want them to sent to?

In this case, I have made a few omissions. Change anything in red

 

=========

 

<script language="javascript">

function crunchThis()

{

var theSubject = document.theQuestions.enteredSubject.value

var theMessage = document.theQuestions.enteredMessage.value

 

self.location="mailto:[email protected]?subject=" +theSubject+ "&body=" +theMessage;

}

 

 

E-mail: (will be sent to my address)

Subject

 

 

Message

 

 

Co-Moderator for IT -inerary forum

Biker nerd • Windows • Apple Mac • Android user

 

"Kick up your sidestand bro, let's ride..."

Posted

i placed it in my body but when i tried sending to another mailbox, it does not send to the email that i put...or rather the message did not go through?...~whats wrong..~i placed the <script> and

together in the
Posted

Take note that this is more of a "no-frills" implementation of an e-mail form.

 

The last code that I've given you should open an e-mail client:

 

(Picture)

http://img175.imageshack.us/img175/9271/emailpf9.th.jpg

 

...where users can choose to amend, edit, and then send the message -- if they have an e-mail client installed.

 

If you think this is not streamlined, i agree -- that's the limitation of JavaScript. You need to setup and code in PHP (and its Mail() functionality) if you want a more cleaner, webpage-based e-mail capability.

 

==========

 

This is the code. I've checked, rechecked, and verified it to be working. It should provide you with the scenario described above (see picture above)

 

<script language="javascript">

function crunchThis()

{

var theSubject = document.theQuestions.enteredSubject.value

var theMessage = document.theQuestions.enteredMessage.value

 

self.location="mailto:[email protected]?subject=" +theSubject+ "&body=" +theMessage;

}

 

 

E-mail: (will be sent to my address)

 

 

Subject

 

 

Message

 

 

Co-Moderator for IT -inerary forum

Biker nerd • Windows • Apple Mac • Android user

 

"Kick up your sidestand bro, let's ride..."

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • DAIS_ShellBAU2024_Motorcycle_SingaporeBikesBanner_300x250.jpg

     
×
×
  • Create New...