Skip to main content
Participant
November 20, 2008
Question

Form input and eCommerce.. need help

  • November 20, 2008
  • 2 replies
  • 537 views
I'm currently setting up a very small ecommerce website where I sell my service (so it's one item, nothing too big). I've been using lynda.com and it's helped, but this is my problem. On the order page, where the billing info is entered, I need to have forms there because the customer needs to enter specifications, so that upon entering billing information and the input fields, and hitting BUY or w/e, all of the info they entered is sent to my database (or email, or wheever I access it). Does anyone know if this is possible?

Edit: I'm using Dreamweaver CS4, and Cartweaver ColdFusion 2.
This topic has been closed for replies.

2 replies

Inspiring
November 21, 2008
Billing Info Page:
<form action="end.cfm" method="post" name="done">
<cfoutput>
<input name="Name" type="text" id="Name">
<input name="Buy" type="submit" class="buttons" value="Buy">
</cfoutput>
</form>

End.cfm page:

<cfparam name="Form.Name" default="">
<cfquery name="name" datasource"datasource">
Insert Into Tablename (columnname)
Values ('#Name#')
</cfquery>

<cfmail from="w/e@domain.com" to="w/e@domain.com" subject="name" type="html">
#Name#
</cfmail>

---redirect to another page----
<script>
self.location="page.cfm;"
</script>



that's how I understand your question....hope it helps
Inspiring
November 20, 2008
It's possible.

What part are having difficulty with?
nouOUAuthor
Participant
November 20, 2008
quote:

Originally posted by: Dan Bracuk
It's possible.

What part are having difficulty with?


The code. The billing info and the input fields would all be on the same page, so when he hits the button to submit his order, I want all the info to be dispatched properly. I've tried googling the code for this but can't seem to find it. I'm a noob.
BKBK
Community Expert
Community Expert
November 21, 2008
NouOU wrote:
The code. The billing info and the input fields would all be on the same page, so when he hits the button to submit his order, I want all the info to be dispatched properly.

It's a wide area and yet you say so little about what you need. Do you know how to code HTML forms and how to process the submitted result? That is all it takes.

Store the billing information you already have as the value attribute in the respective form fields. Use hidden fields for information you don't want to show the user. In the following examples, I have assumed that you have adopted the common practice of storing information about an order in a session.

<SELECT NAME="color">
<option value = "">Select color</option>
<OPTION VALUE="g">Green</option>
<OPTION VALUE="b">Blue</option>
<OPTION VALUE="y">Yellow</option>
<OPTION VALUE="o">Orange</option>
<OPTION VALUE="#session.colorCode#" SELECTED>#color#</option>
</SELECT>

<input type="Text" name="itemName" value="#session.item#">

<input type="hidden" name="orderCode" value="#session.code#">


Create new input fields to enable you to get new information from the user. For example,

Your e-mail address: <input type="Text" name="email" size="30" maxlength="100">