forms

jongr81

New Member
Can somebody please help me?
I am making a webpage for my landscaping business and I am a beginner and use a program called webexpress. It allows me to make forms but I don’t know how to get things to work within it.
This is what I am hoping to accomplish:
The user fills out information within the form by their written answers and by selection of boxes.
Within this form, the user will also select a zip code.
When the zip code is entered they would be brought to a new page.
The new page would be whichever zip code is selected; they would be brought to that representatives profile page.
All the data that the user entered will at the same time be emailed to that zip code representative.
Can anybody please help?!!!!
 

bowenac

New Member
If your using C# here is some code that would do the redirect, the email is pretty simple as well and if you would like some help with that let me know.

<form id="form1" runat="server">
<div>
<asp:Label ID="Label1" runat="server" Text="Label">Zip Code</asp:Label>
<br />
<asp:TextBox ID="txtZipCode" runat="server"></asp:TextBox>
<br />
<asp:Button ID="Button1" runat="server" Text="Button" onclick="Button1_Click" />
</div>
<asp:Label ID="lblmessage" runat="server" Text=""></asp:Label>
</form>




Code Behind


protected void Button1_Click(object sender, EventArgs e)
{
if (txtZipCode.Text == "98374")
Response.Redirect("98374.aspx");

else if (txtZipCode.Text == "98444")
Response.Redirect("98444.aspx");

else lblmessage.Text = "Please enter a valid zip code.";


}
 

bowenac

New Member
I just though you are probably going to want to use a drop down list. So here is how you would do that...
aspx page code... The Smiles are a : and D in case you are wondering...


<div>
<asp:DropDownList ID="ddlCity" runat="server" Height="16px" Width="106px">
<asp:ListItem>Select City</asp:ListItem>
<asp:ListItem>Tacoma</asp:ListItem>
<asp:ListItem>Seattle</asp:ListItem>
</asp:DropDownList>
<br />
<br />
<asp:Button ID="Button1" runat="server" onclick="Button1_Click" Text="Button" />
<br />
<asp:Label ID="lblmessage" runat="server" Text=""></asp:Label>
</div>


Code behind aspx.cs

protected void Button1_Click(object sender, EventArgs e)
{
if (ddlCity.SelectedItem.Value == "Tacoma")
Response.Redirect("Tacoma.aspx");
else if (ddlCity.SelectedItem.Value == "Seattle")
Response.Redirect("Seattle.aspx");

else lblmessage.Text = "Please select a city.";

}


If you would like any help with this I can help you through a remote session. I hope this helps, obviously you would have to edit the values, but this should get you going.
 

jongr81

New Member
Here is a small sample of what I have. Going this route with the cgi is not permitted on my free angelfire.com host site. How do I incorporate the aspx feature? Then again, all that will be doing is sending me an email of data collected. How can I also incorporate the zipcode to open to a new url page of representative?

<FORM ACTION="cgi-bin/mvforms.cgi" METHOD="POST">
<INPUT TYPE=HIDDEN NAME="subject" VALUE="I am interested">
<INPUT TYPE=HIDDEN NAME="email_dest" VALUE="[email protected]">
<DIV>
<P ALIGN=LEFT>
<FONT COLOR="BLACK"><FONT SIZE="4">Last
Name&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
First Name</FONT></FONT><BR>
<INPUT TYPE=TEXT NAME="firstname" VALUE="Last Name" SIZE="20" MAXLENGTH="256"><FONT COLOR="BLACK"><FONT SIZE="4">,
<INPUT TYPE=TEXT NAME="firstname" VALUE="First Name" SIZE="20" MAXLENGTH="256"> Mr.<INPUT TYPE=RADIO NAME="Mr" VALUE="Mr."> Mrs.<INPUT TYPE=RADIO NAME="mr" VALUE="Mrs."></FONT></FONT></P>
</DIV>
<P ALIGN=LEFT>
<FONT COLOR="BLACK"><FONT SIZE="4"><!-- $MVD$:spaceretainer() --></FONT></FONT>&nbsp;</P>
<P ALIGN=LEFT>
<FONT COLOR="BLACK"><FONT SIZE="4">Choose your zip code</FONT></FONT></P>
<DIV>
<P ALIGN=LEFT>
<SELECT NAME="Zip Code" SIZE="1"><OPTION VALUE="Alexandria 46001">46001<OPTION VALUE="Anderson 46011">46011<OPTION VALUE="Anderson 46012">46012</SELECT></P>
</DIV>
<DIV>
<P ALIGN=LEFT>
<INPUT TYPE=SUBMIT NAME="Submit" VALUE="Submit"></P>
</DIV>
</FORM>
 

bowenac

New Member
by the way, THANKS for your input so far!


I am assuming you are using a linux server then if your host isn't supporting asp. If you could find out and get back to me that would be great, then I can explain how to do the zip redirect.
 
Top