Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Convert the fields into Hidden and insert default values

Posted on 2008-11-05
2
Medium Priority
?
213 Views
Last Modified: 2008-11-06
How can I convert the required fields in the code below for city, state, zip and fax into hidden and put in default values so users do not have to enter them when they register for the site?
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>{$meta_title}</title>
<meta http-equiv="Content-Type" content="text/html; charset={$meta_encoding}">
<meta name="keywords" content="{$meta_keyword}">
<meta name="description" content="{$meta_description}">
 
{$javascript_rightclick}
<script language="javascript" type="text/javascript" src="javascript.js"></script>
<link href="class.css" type="text/css" rel="stylesheet">
</head>
 
<body>
<table cellpadding="0" cellspacing="0" border="0" align="center">
<!-- global_top.html -->
{include file="global_top.html"} 
<!-- global_top.html -->
 
<tr>
	<td width="10"><img src="images/spacer.gif" border="0" width="10" height="1"></td>	
	<td valign="top">
	
		<!-- global_left.html -->
		{include file="global_left.html"} 
		<!-- global_left.html -->
	
	</td>
	<td width="5"><img src="images/spacer.gif" border="0" width="5" height="1"></td>	
	<td valign="top">
	
		<!-- center for content -->
		<table cellpadding="0" cellspacing="0" border="0" align="center">
		<tr>
			<td><img src="images/center_left_top.gif" width="10" height="6"></td>
			<td background="images/center_hor_top.gif"><img src="images/spacer.gif" width="1" height="1"></td>
			<td><img src="images/center_right_top.gif" width="10" height="6"></td>
		</tr>
		<tr>
			<td width="10" background="images/center_ver_left.gif"><img src="images/spacer.gif" width="1" height="1"></td>
			<td width="560" height="650" valign="top" style="padding-left:5px; padding-right:5px; padding-top:20px; padding-bottom:20px">
			
				<table width="560" cellpadding="0" cellspacing="0" class="normal_12_black" border="0">
				<tr>
					<td><img src="site_title_header.php?title=Private Seller Registration ..."></td>
				</tr>
				<tr>
					<td height="20"><img src="images/spacer.gif" width="1" height="1"></td>
				</tr>
				<!--
				<tr>
					<td>
						Lor
					</td>
				</tr>
				-->
				<!-- the tab -->
				<tr>
					<td height="30"><img src="images/spacer.gif" width="1" height="1"></td>
				</tr>
				<!-- the tab -->
				<tr>
					<td>
 
						<form action="system_member_register_private.php" method="post">
						<table border="0" cellpadding="4" cellspacing="0" class="normal_12_black">
						<tr>
							<td colspan="3">
								
								{if $warning_message == "username_exist"}
								
								<font class="normal_12_red">
								The username you choosed already exists.<br>
								Please choose another username to continue ...
								</font>
								
								{elseif $warning_message == "incomplete_form"}
								<font class="normal_12_red">
								Please fill the following form completely.<br>
								Please make sure that you have filled the fields marked red ...
								</font>
								
								{else}
								Please fill the following form completely.<br>
								Please make sure that you have filled the fields marked red ...
								{/if}
 
							</td>
						</tr>
 
						<tr>
							<td height="10" colspan="3"><img src="images/spacer.gif" width="1" height="1"></td>
						</tr>
						<tr>
							<td colspan="3" height="28" background="images/bg_tab.gif" style="background-repeat:no-repeat; padding-left:28px; padding-top:5px" class="normal_12_blue_verdana" valign="top">
								<strong>Enter Account Information ... </strong>
							</td>
						</tr>
						<tr>
							<td width="120"><font class="{$warning_member_username}"><b>Username</b></font> <font class="normal_12_red">*</font></td>
							<td width="10"><b>:</b></td>
							<td width="480">
								<input type="text" name="member_username" value="{$cmember_username}" class="textbox" style="width:150px">
								{php} $_SESSION['cmember_username_warn'] = ''; {/php}
							</td>
						</tr>
						<tr>
							<td><font class="{$warning_member_password}"><b>Password</b></font> <font class="normal_12_red">*</font></td>
							<td><b>:</b></td>
							<td>
								<input type="password" name="member_password" value="{$cmember_password}" class="textbox" style="width:150px">
								{php} $_SESSION['cmember_password_warn'] = ''; {/php}
							</td>
						</tr>
						<tr>
							<td height="10" colspan="3"><img src="images/spacer.gif" width="1" height="1"></td>
						</tr>
						<tr>
							<td colspan="3" height="28" background="images/bg_tab.gif" style="background-repeat:no-repeat; padding-left:28px; padding-top:5px" class="normal_12_blue_verdana" valign="top">
								<strong>Enter Personal Information ... </strong>
							</td>
						</tr>
						<tr>
							<td><font class="{$warning_member_firstname}"><b>First Name</b></font> <font class="normal_12_red">*</font></td>
							<td><b>:</b></td>
							<td>
								<input type="text" name="member_firstname" value="{$cmember_firstname}" class="textbox" style="width:250px">
								{php} $_SESSION['cmember_firstname_warn'] = ''; {/php}
							</td>
						</tr>
						<tr>
							<td><font class="{$warning_member_lastname}"><b>Last Name</b></font></td>
							<td><b>:</b></td>
							<td>
								<input type="text" name="member_lastname" value="{$cmember_lastname}" class="textbox" style="width:250px">
								{php} $_SESSION['cmember_lastname_warn'] = ''; {/php}
							</td>
						</tr>
						<tr>
							<td valign="top"><font class="{$warning_member_address}"><b>Mailing<br>Address</b></font> <font class="normal_12_red">*</font></td>
							<td valign="top"><b>:</b></td>
							<td>
								<textarea name="member_address" style="width:350px; height:70px" class="textbox">{$cmember_address}</textarea>
								{php} $_SESSION['cmember_address_warn'] = ''; {/php}
							</td>
						</tr>
						<tr>
							<td><font class="{$warning_member_city}"><b>City / Town</b></font> <font class="normal_12_red">*</font></td>
							<td><b>:</b></td>
							<td>
								<input type="text" name="member_city" value="{$cmember_city}" class="textbox" style="width:200px">
								{php} $_SESSION['cmember_city_warn'] = ''; {/php}
							</td>
						</tr>
						<tr>
							<td><font class="{$warning_member_state}"><b>State / Province</b></font> <font class="normal_12_red">*</font></td>
							<td><b>:</b></td>
							<td>
								<input type="text" name="member_state" value="{$cmember_state}" class="textbox" style="width:200px">
								{php} $_SESSION['cmember_state_warn'] = ''; {/php}
							</td>
						</tr>
						<tr>
							<td><font class="{$warning_member_zip}"><b>ZipCode</b></font> <font class="normal_12_red">*</font></td>
							<td><b>:</b></td>
							<td>
								<input type="text" name="member_zip" value="{$cmember_zip}" class="textbox" style="width:80px">
								{php} $_SESSION['cmember_zip_warn'] = ''; {/php}
							</td>
						</tr>
						<tr>
							<td><font class="{$warning_member_country}"><b>Country</b></font> <font class="normal_12_red">*</font></td>
							<td><b>:</b></td>
							<td>
								<select name="member_country" class="textbox" style="width:350px">
								{section name=var loop=$member_country}
								<option value="{$member_country_id[var]}" {if $member_country_id[var] == $cmember_country} selected {/if}>{$member_country_name[var]}</option>
								{/section}
								</select>
								{php} $_SESSION['cmember_country_warn'] = ''; {/php}
							</td>
						</tr>
						<tr>
							<td height="10" colspan="3"><img src="images/spacer.gif" width="1" height="1"></td>
						</tr>
						<tr>
							<td colspan="3" height="28" background="images/bg_tab.gif" style="background-repeat:no-repeat; padding-left:28px; padding-top:5px" class="normal_12_blue_verdana" valign="top">
								<strong>Enter Contact Information ... </strong>
							</td>
						</tr>
						<tr>
							<td><font class="{$warning_member_phone}"><b>Phone</b></font> <font class="normal_12_red">*</font></td>
							<td><b>:</b></td>
							<td>
								<input type="text" name="member_phone" value="{$cmember_phone}" class="textbox" style="width:250px">
								{php} $_SESSION['cmember_phone_warn'] = ''; {/php}
							</td>
						</tr>
						<tr>
							<td><font class="{$warning_member_fax}"><b>Fax</b></font></td>
							<td><b>:</b></td>
							<td>
								<input type="text" name="member_fax" value="{$cmember_fax}" class="textbox" style="width:250px">
								{php} $_SESSION['cmember_fax_warn'] = ''; {/php}
							</td>
						</tr>
						<tr>
							<td><font class="{$warning_member_email}"><b>Email Address</b></font> <font class="normal_12_red">*</font></td>
							<td><b>:</b></td>
							<td>
								<input type="text" name="member_email" value="{$cmember_email}" class="textbox" style="width:250px">
								{php} $_SESSION['cmember_email_warn'] = ''; {/php}
							</td>
						</tr>
						<tr>
							<td></td>
							<td></td>
							<td><input type="submit" name="submit" value="Register Now" class="form_button"></td>
						</tr>
						</table>
						</form>
 
					</td>
				</tr>
				</table>
 
				
			</td>
			<td width="10" background="images/center_ver_right.gif"><img src="images/spacer.gif" width="1" height="1"></td>
		</tr>
		<tr>
			<td><img src="images/center_left_bottom.gif" width="10" height="6"></td>
			<td background="images/center_hor_bottom.gif"><img src="images/spacer.gif" width="1" height="1"></td>
			<td><img src="images/center_right_bottom.gif" width="10" height="6"></td>
		</tr>
		</table>
		<!-- center for content -->
	
	</td>
	<td width="5"><img src="images/spacer.gif" border="0" width="5" height="1"></td>	
	<td valign="top">
	
		<!-- global_right.html -->
		{include file="global_right.html"} 
		<!-- global_right.html -->
	
	</td>
	<td width="10"><img src="images/spacer.gif" border="0" width="10" height="1"></td>	
</tr>
 
<!-- global_bottom.html -->
{include file="global_bottom.html"} 
<!-- global_bottom.html -->
</table>
 
</body>
</html>

Open in new window

0
Comment
Question by:Starquest321
2 Comments
 
LVL 10

Accepted Solution

by:
Tyler Laczko earned 2000 total points
ID: 22886887
I have included an example for city

test with this for city then do the same for all.

REPLACE-----------



                                    <tr>
                                          <td><font class="{$warning_member_city}"><b>City / Town</b></font> <font class="normal_12_red">*</font></td>
                                          <td><b>:</b></td>
                                          <td>
                                                <input type="text" name="member_city" value="{$cmember_city}" class="textbox" style="width:200px">
                                                {php} $_SESSION['cmember_city_warn'] = ''; {/php}
                                          </td>
                                    </tr>



With Attached -------------
<input type="hidden" name="member_city" value="PUT VALUE IN HERE" />

Open in new window

0
 

Author Comment

by:Starquest321
ID: 22894575
Thanks it works!
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Build an array called $myWeek which will hold the array elements Today, Yesterday and then builds up the rest of the week by the name of the day going back 1 week.   (CODE) (CODE) Then you just need to pass your date to the function. If i…
3 proven steps to speed up Magento powered sites. The article focus is on optimizing time to first byte (TTFB), full page caching and configuring server for optimal performance.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
Suggested Courses
Course of the Month20 days, 22 hours left to enroll

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question