Need Ignor required field in some case - html

Greeting,
I need to avoid validation for required field. When I click one button and this field will be required, and form will not submitted unless... And if I click another button, required field will be ignored, and the form submitted(Both are buttons within the same form for example).
<cfform name="SubmitToHR" action="Action.cfm">
<table>
<tr>
<td class="Form" bgcolor="FFFBF0">#Var#</td>
<td width="39">
<cfinput type="Text" value="#Comments#" name="Comment" size="39" maxlength="100" lass="Text5" style="height:21" required="no">
</td>
<td width="127">
<cfinput name="CheckDate" type="datefield" value="#Paycheck#" class="Text" style="height:21" size="18" required="yes" message="Select Date">
</td>
</tr>
</table>
<table>
<tr>
<td class="Center">
<cfinput name="Operation" type="submit" class="ButtonOrange" value="Submit">
</td>
</tr>
<tr>
<td class="Center">
<cfinput name="Operation" type="submit" class="ButtonRed" value="Not Approve">
</td>
</tr>

Something like this?
<script>
function checkInput(mode)
{
if (mode == 1) {
if (SubmitToHR.CheckDate.value.length == 0)
{
window.alert('Select Date');
} else {
document.forms['SubmitToHR'].submit();
}
} else if (mode == 2) {
document.forms['SubmitToHR'].submit();
}
return false;
}
</script>
<cfset Var = "Test1">
<cfset Comments = "Test1">
<cfset Paycheck = "01/01/2020">
<form name="SubmitToHR" method="post" action="Action.cfm">
<cfoutput>
<table>
<tr>
<td class="Form" bgcolor="FFFBF0">#Var#</td>
<td width="39">
<input type="Text" value="#Comments#" name="Comment" size="39" maxlength="100" class="Text5" style="height:21" required="no">
</td>
<td width="127">
<input name="CheckDate" type="Text" value="#Paycheck#" class="Text" style="height:21" size="18" required="no" message="Select Date">
</td>
</tr>
</table>
<table>
<tr>
<td class="Center">
<input name="Operation" type="button" class="ButtonOrange" value="Submit" onclick="checkInput(1);">
</td>
</tr>
<tr>
<td class="Center">
<input name="Operation" type="button" class="ButtonRed" value="Not Approve" onclick="checkInput(2);">
</td>
</tr>
</table>
</cfoutput>
</form>

Related

How do I make a checkbox inside a table enable or disable text inputs in the same table?

Only in Html for JSP and servlets. I have two checkbox there with two options "Yes" and "No". If, 'yes' enable all text inputs below it. if 'no' disable. This is my JSP:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css" href="RegiPageDesign.css">
<title>Registration Page</title>
</head>
<body>
<div><h1>Please Provide the Following Details:</h1></div>
<form action="Servlet1" method="POST">
<table border="0">
<tbody>
<tr>
<td style="color: black">Vehicle Owners Name:</td>
<td><input type="text" name="vowner" value="" size="20" placeholder="e.g John Van Wyk"/></td>
</tr>
<tr>
<td style="color: black">Vehicle Drivers Name:</td>
<td><input type="text" name="vdriver" value="" size="20" placeholder="e.g Matheus Malima" /></td>
</tr>
<tr>
<td style="color: black">Vehicle Registration Number:</td>
<td><input type="text" name="vreginumber" value="" size="20" placeholder="e.g N 168-1258 W" /></td>
</tr>
<tr>
<td style="color: black">NABTA ID:</td>
<td><input type="text" name="nabtaId" value="" size="20" placeholder="e.g NABTA685" /></td>
</tr>
<tr>
<td style="color: black">Vehicle Type:</td>
<td><select name="vtype">
<option>Bus</option>
<option>Minibus</option>
<option>Taxi</option>
</select></td>
</tr>
<tr>
<td style="color: black">Vehicle Model:</td>
<td><input type="text" name="vmodel" value="" size="10" placeholder="e.g 2010" /></td>
</tr>
<tr>
<td style="color: black">Vehicle Mass:</td>
<td><input type="text" name="vmass" value="" placeholder="e.g 1.3 Tons" /></td>
</tr>
<tr>
<td style="color: black">Vehicle Color:</td>
<td><select name="colors">
<option>White</option>
<option>Silver</option>
<option>Red</option>
<option>Black</option>
<option>Blue</option>
</select></td>
</tr>
<tr>
<td style="color: black"> Was the vehicle in an Accident: </td>
<td>
<input type="checkbox" name="boo" value="" />Yes<br>
<input type="checkbox" name="boo" value="" />No<br>
</td>
</tr>
<tr>
<td style="color: black">How Many Times: </td>
<td><input type="text" name="number" value="" placeholder="Number(s)"/></td>
</tr>
<tr>
<td style="color: black">Cause of Accidents:</td>
<td><input type="text" name="vaccident" value="" placeholder="e.g Drunk Driving" /></td>
</tr>
<tr>
<td style="color: black">Date and Place of Accident:</td>
<div2><td><input type="date" name="adate" value="" placeholder="DD-MM-YY" /></div2>
<input type="text" name="regions" value="" placeholder="e.g Windhoek, Rehoboth" />
</td>
</tr>
</tbody>
</table>
<p style="text-align: center;"> <input type="reset" value="Clear" />
<input type="submit" value="Next" /></p>
<input type="button" value="Back" name="back"/>
</body>
</form>
</html>
It can be easily done by jQuery(Add this library to your header part), check the following script.
$('input[name=boo]').change(function(){
if(this.value=="yes"){
$(".accident").prop('disabled', false);
} else {
$(".accident").prop('disabled', true);
}
});
I assume that yes or no should be radio, since both cannot happen at the time ;) . See the live demo of working copy. Hope it helps.
Ok, this solution is do based on your title.
add javascript before <body>
<head>
<script language="Javascript">
function change()
{
var element = document.getElementById('textfieldID'); //depend which text field you wanted to disabled then add ID attribute for that textfield
var array = [];
while(element)
{
array.push(element);
element.id = 'textfieldID' + '-processed';
element = document.getElementById('textfieldID');
}
for(var i = 0; i < array.length; i++)
{
array[i].id = 'textfieldID';
if(document.mainform.boo.checked == true)
array[i].disabled=true;
else
array[i].disabled=false;
}
}
</script>
</head>
add onchange function for your checkbox
<tr>
<td style="color: black"> Was the vehicle in an Accident: </td>
<td>
<input type="checkbox" name="boo" value="" onchange="change();/>Yes<br>
<input type="checkbox" name="boo" value="" onchange="change();/>No<br>
</td>
</tr>
if you wanted to disabled all your input textfields when checkbox is checked. Then add all the same ID="" attribute in your input textfields. Hope it helps

Cannot disable listbox in Firefox when checkbox is checked

I need to disable 2 listboxes when a checkbox is checked. The code below behaves properly in IE but the listboxes do not disable in Firefox and Chrome. When the checkbox, cb_SameAccess is checked, I need to prevent the user from being able to select a value from the listboxes, system and region. These listboxes are created using coldfusion code.
<cfif isdefined("formerrors.sameas_empid")><span class=errors>>></span></cfif>
<!--<td width=280 class=default><span class="errors">*</span> Request same access as employee (T-ID):</td>-->
<td><input type="checkbox" name="cb_SameAccess" id="cb_SameAccess" value=1 onclick="disableSystemRegion()">Same access as employee (TID, XID):<br></td>
<!--<td colspan=2><input type="checkbox" id="cb_Role" onclick="enableDates()">Act as another role for a period of time<br></td>-->
<td class="default">
<input type="text" size=10 name="sameas_empid" value="#htmlEditFormat(sameas_empid)#">
</td>
</tr>
</table>
</div> <!--- applicantInfo --->
<div id="systemRegion">
<table border=1 style="margin-bottom:10px;">
<tr id="divnewaccess2">
<td class="default" colspan="2">
<span class="errors">*</span> If provided, this will speed up processing of your application.
</td>
</tr>
<!--<tr id="divnewaccess3" style="display:none">-->
<tr id="systemID">
<cfif isdefined("formerrors.region")><span class=errors>>></span></cfif>
<td width=280 class=label>#say('system')#(s):</td>
<td width=300 id="colSystem">
<cf_customlistbox
selectattr='name="system" class=small size=3 multiple'
values="SKED,OATS,SMC,SRM,TOMCAT"
options="SKED,OATS,SMC,SRM/SGR,TOMCAT"
default="#system#">
</td>
</tr>
<tr id="regionID">
<cfif isdefined("formerrors.region")><span class=errors>>></span></cfif>
<td width=280 class=label>#say('region')#(s):</td>
<td width=300 id="colRegion">
<cf_dblistbox
datasource="#application.DSN#"
query="SELECT region as value,description AS label
FROM SRM_region
WHERE 1=1 and province!=''
ORDER BY region "
default="#region#"
selectattr='class=small name="region" size=4 multiple'>
</td>
</tr>
</table>
</div> <!--- systemRegion --->
When the checkbox is checked, it will call the javascript function, disableSystemRegion()
function disableSystemRegion()
{
if(document.getElementById('cb_SameAccess').checked)
{
alert("not enabled");
<cfset system = "testSystem">
<cfset region = "testRegion">
//jQuery("input[type='text']").attr("disabled", 'disabled');
//jQuery("input[type='text']").prop("disabled", true);
//document.getElementById('sameAccess').disabled = true;
//document.getElementById('system').disabled = true;
//document.getElementsByName('colSystem').setAttribute('disabled',true);
document.getElementById('colSystem').setAttribute("disabled","disabled");
document.getElementById('colRegion').setAttribute("disabled","disabled");
//document.getElementById('system').setAttribute("disabled","disabled");
//document.getElementById('region').setAttribute("disabled","disabled");
//document.getElementById('region').disabled = true;
}
else
{
alert("enabled");
//document.getElementById('sameAccess').disabled = false;
//document.getElementById('sameAccess').setAttribute('disabled',false);
//document.getElementById('colSystem').setAttribute('disabled',false);
//document.getElementById('colRegion').setAttribute('disabled',false);
//document.getElementsByName('colSystem').removeAttribute("disabled");
//document.getElementById('system').removeAttribute("disabled");
//document.getElementById('region').removeAttribute("disabled");
document.getElementById('colSystem').removeAttribute("disabled");
document.getElementById('colRegion').removeAttribute("disabled");
// document.getElementById('region').disabled = false;
}
}
It behaves properly in IE, but I cannot get it to disable in Firefox and Chrome. Any help will be appreciated. Thanks in advance! Below is my code for the form.
<form class="entryform" id="entryform" name="entryform" action="#ME#" method="post"> <!--- Don't use name attribute in form element, use id --->
<!--<form id="entryform" action="#ME#" method="post">-->
<input type="hidden" name="mode" value="save">
<div class="header" id="header">
<img width=50 height=50 src="#application.IMAGEDIR#/account_application.gif"> #say('account_application_step1')#
</div> <!--- header --->
<div class="tableInstructions1" id="instructions1">
<table style="border:solid red 1px;" class="body">
<tr>
<td>
<p class=section><b>#say('account_application_approval_new')#</b></p>
<p class=body"><span class="errors">*</span> #say('employee_updates_not_include')#</p>
</td>
</tr>
</table>
</div> <!--- instructions1 --->
<div id="instructions2">
<p class=body>
#say('account_approval')#
#say('return_to_srm')#
</p>
</div> <!--- instructions2 --->
<div id="applicantInfo">
<p class=section>#say('account_application_info')#:</p>
<table frame="border" style="margin-bottom:10px;">
<tr>
<cfif isdefined("formerrors.userid")><span class=errors>>></span></cfif>
<td width=280 class=label nowrap>#say('employee_id')# (e.g. 12345):</td>
<td class="default"><input type="text" size=10 name="userid" value="#htmlEditFormat(userid)#">
[ <a class="body" href="javascript: checkuserid();">#say('verify')#</a> ]
</td>
</tr>
<tr>
<td class="default" colspan="2">
<span class="errors">*</span> If contractor, please provide your XID.
</td>
</tr>
<tr>
<cfif isdefined("formerrors.firstname")><span class=errors>>></span></cfif>
<td width=280 class=label>#say('firstname')#:</td>
<td><input type="text" size=20 name="firstname" value="#htmlEditFormat(firstname)#"></td>
</tr>
<tr>
<cfif isdefined("formerrors.lastname")><span class=errors>>></span></cfif>
<td width=280 class=label>#say('lastname')#:</td>
<td><input type="text" size=20 name="lastname" value="#htmlEditFormat(lastname)#"></td>
</tr>
<tr>
<cfif isdefined("formerrors.email")><span class=errors>>></span></cfif>
<td width=280 class=label>#say('email')#:</td>
<td><input type="text" size=20 name="email" value="#htmlEditFormat(email)#"></td>
</tr>
<tr>
<cfif isdefined("formerrors.phone")><span class=errors>>></span></cfif>
<td width=280 class=label>#say('phone_number')#:</td>
<td><input type="text" size=20 name="phone" onblur=validatePhoneNum() value="#htmlEditFormat(phone)#"></td>
</tr>
<tr>
<cfif isdefined("formerrors.sameas_empid")><span class=errors>>></span></cfif>
<!--<td width=280 class=default><span class="errors">*</span> Request same access as employee (T-ID):</td>-->
<td><input type="checkbox" name="cb_SameAccess" id="cb_SameAccess" value=1 onclick="disableSystemRegion()">Same access as employee (TID, XID):<br></td>
<!--<td colspan=2><input type="checkbox" id="cb_Role" onclick="enableDates()">Act as another role for a period of time<br></td>-->
<td class="default">
<input type="text" size=10 name="sameas_empid" value="#htmlEditFormat(sameas_empid)#">
</td>
</tr>
</table>
</div> <!--- applicantInfo --->
<div id="systemRegion">
<table border=1 style="margin-bottom:10px;">
<tr id="divnewaccess2">
<td class="default" colspan="2">
<span class="errors">*</span> If provided, this will speed up processing of your application.
</td>
</tr>
<!--<tr id="divnewaccess3" style="display:none">-->
<tr id="systemID">
<cfif isdefined("formerrors.region")><span class=errors>>></span></cfif>
<td width=280 class=label>#say('system')#(s):</td>
<td width=300 id="colSystem">
<cf_customlistbox
selectattr='name="system" class=small size=3 multiple'
values="SKED,OATS,SMC,SRM,TOMCAT"
options="SKED,OATS,SMC,SRM/SGR,TOMCAT"
default="#system#">
</td>
</tr>
<tr id="regionID">
<cfif isdefined("formerrors.region")><span class=errors>>></span></cfif>
<td width=280 class=label>#say('region')#(s):</td>
<td width=300 id="colRegion">
<cf_dblistbox
datasource="#application.DSN#"
query="SELECT region as value,description AS label
FROM SRM_region
WHERE 1=1 and province!=''
ORDER BY region "
default="#region#"
selectattr='class=small name="region" size=4 multiple'>
</td>
</tr>
</table>
</div> <!--- systemRegion --->
<div id="date">
<table border=1>
<tr>
<td colspan=2><input type="checkbox" name="cb_Role" value=1 id="cb_Role" onclick="enableDates()">Act as another role for a period of time<br></td>
</tr>
<tr>
<cfif isdefined("formerrors.act_startdate")><span class=errors>>></span></cfif>
<cfset ico.cal = '<img alt="Calendar" border=0 height=13 width=13 src="#application.IMAGEDIR#/icons/calendar.gif">'>
<td width=280 class="label"> Start Date:</td>
<td>
<input type="text" id="txtStartDate" name="act_startdate" size="13" disabled>
<!--<img alt="Calendar" border=0 height=13 width=13 src="/srm/images/icons/calendar.gif"> -->
<!--I am a useless link-->
<a id="startDateID" href="javascript: date(document.entryform.act_startdate);">#ico.cal#</a>
<!--<img alt="Calendar" border=0 height=13 width=13 src="/srm/images/icons/calendar.gif"></a> -->
</td>
</tr>
<tr>
<cfif isdefined("formerrors.act_enddate")><span class=errors>>></span></cfif>
<td width=280 class="label"> End Date:</td>
<td>
<input type="text" id="txtEndDate" name="act_enddate" size="13" disabled>
<a id="endDateID" href="javascript: date(document.entryform.act_enddate);">#ico.cal#</a>
<!--<img alt="Calendar" border=0 height=13 width=13 src="/srm/images/icons/calendar.gif">-->
</td>
</tr>
</table>
</div> <!--- date --->
<div id="comments">
<p class=section>#say('comments_and_special_instructions')#</p>
<ul class="body">
<!--<div id="divnewaccess4" style="display:none">-->
<div id="divnewaccess4">
<li>#say('systems_and_regions')#?
<li>#say('duties_and_dep')#?
</div>
<!--<div width=200 id="divneedmore2" style="display:none">-->
<div width=200 id="divneedmore2">
<li>Need Access for particular function, please specify name of function or function ID.</li>
<li>If Job duties,department or Profile changed, please specify old and new both responsibilities.</li>
</div>
<li>#say('additional_details')#.
</ul>
<cfif isdefined("formerrors.comments")><span class=errors valign=top>>></span><br></cfif>
</div> <!--- comments --->
<div id="textarea">
<textarea name="comments" cols=60 rows=5>#htmlEditFormat(comments)#</textarea>
<input type="submit" value="#say('submit')#">
<input onClick="document.location.href = '#application.WWWROOT#/';" type="button" value="#say('cancel')#">
<input type="hidden" name="accesstypehidden" id="accesstypehidden" value="#accesstypehidden#">
</div> <!--- textarea --->
</form>
</body>
The problem is that colSystem and colRegion are the ids of table cells, and not the ids of the controls you want to disable. So, you make the entire table cell disabled.
<td width=300 id="colSystem">
While IE behaves differently, FF and Chrome do not make elements disabled if parent is disabled.
Check out this small example in FF and IE, you will notice the difference:
http://jsfiddle.net/3BmKc/

Making Text Boxes Aligned

I am having an issue right now. When I load up my webpage, all of the boxes/words are aligned awkwardly, and I was wondering if I can get some help aligning the boxes all to be on the same line.
click here for a jsfiddle demo
<table bgcolor="#bbbbbb" width="100%" border="0" cellspacing="0" cellpadding="0" valign="center">
<tr>
<td width="10%" valign="top" align="center">
<form name="form1" method="post" action="checklogin.php">
<font size="5"><strong>Account Login</strong></font><br />
Username :
<input name="myusername" type="text" id="myusername"><br />
Password :
<input name="mypassword" type="password" id="mypassword"> <br />
<input style="width:75px; font-size:14px; height:25px;" type="submit" name="Submit" value="Login">
</form>
</td>
<td width="10%" valign="top" align="center">
<form id="form1" name="form1" method="post" action="registration_script.php">
<font size="5"><strong>Account Register</strong></font><br />
Username :
<input type="text" name="txtUser" id="txtUser" /> <br />
Repeat :
<input name="myusername" type="text" id="myusername"><br />
Password :
<input type="password" name="txtPassword" id="txtPassword" /> <br />
Repeat :
<input name="myusername" type="text" id="myusername"><br />
<input style="width:75px; font-size:14px; height:25px;" type="submit" name="btnRegister" id="btnRegister" value="Register" />
</td>
</tr>
</form>
</table>
try to check this one: Edited
hope this gives the idea(on my own very way:)).
<table bgcolor="#bbbbbb" width="100%" border="0" cellspacing="0" cellpadding="0" valign="center">
<tr>
<td width="10%" valign="top" align="center">
<form name="form1" method="post" action="checklogin.php">
<table>
<thead align="center">Account Login</thead>
<tr>
<td>Username :</td>
<td><input name="myusername" type="text" id="myusername"></td>
</tr>
<tr>
<td>Password :</td>
<td><input name="mypassword" type="password" id="mypassword"></td>
</tr>
<tr>
<td></td>
<td colspan="1"><input style="width:75px; font-size:14px; height:25px;" type="submit" name="Submit" value="Login"></td>
</tr>
</table>
</form>
</td>
<td width="10%" valign="top" align="center">
<form id="form1" name="form1" method="post" action="registration_script.php">
<table>
<thead align="center">Account Register</thead>
<tr>
<td>Username :</td>
<td> <input type="text" name="txtUser" id="txtUser" /></td>
</tr>
<tr>
<td>Repeat :</td>
<td><input name="myusername" type="text" id="myusername"></td>
</tr>
<tr>
<td>Password :</td>
<td><input type="password" name="txtPassword" id="txtPassword" /></td>
</tr>
<tr>
<td>Repeat :</td>
<td><input name="myusername" type="text" id="myusername"></td>
</tr>
<tr>
<td></td>
<td colspan="1"><input style="width:75px; font-size:14px; height:25px;" type="submit" name="btnRegister" id="btnRegister" value="Register" /></td>
</tr>
</table>
</form>
</td>
</tr>
​
In case you don't mind tableless:
<style>
.pseudo-table, form p {
display: table;
background-color: #bbbbbb;
}
.pseudo-cell, form p label {
display: table-cell;
vertical-align: top;
}
form p label {
width: 100px;
}
</style>
<div class='pseudo-table'>
<div class='pseudo-cell'>
<form name='form1' method='post' action='checklogin.php'>
<h2>Account Login</h2>
<p>
<label>Username</label>
: <input name='myusername' type='text' id='myusername'>
</p>
<p>
<label>Password</label>
: <input name='mypassword' type='password' id='mypassword'>
</p>
<button>Login</button>
</form>
</div>
<div class='pseudo-cell'>
<form name='form2' method='post' action='registration_script.php'>
<h2>Account Register</h2>
<p>
<label>Username</label>
: <input type='text' name='txtUser' id='txtUser'>
</p>
<p>
<label>Repeat</label>
: <input name='myusername' type='text' id='myusername'>
</label>
<p>
<label>Password</label>
: <input type='password' name='txtPassword' id='txtPassword'>
</p>
<p>
<label>Repeat</label>
: <input name='myusername' type='text' id='myusername'>
</p>
<button>Login</button>
</form>
</div>
</div>
you can define you own css to define the alignment
for example:
<style>
selector{
float:left;
}
</style>

Using HTML::Template within a value attribute

my question is how would I use an HTML::Template tag inside a value of form field to change that field. For example
<table border="0" cellpadding="8" cellspacing="1">
<tr>
<td align="right">File:</td>
<td>
<input type="file" name="upload" value= style="width:400px">
</td>
</tr>
<tr>
<td align="right">File Name:</td>
<td>
<input type="text" name="filename" style="width:400px" value="" >
</td>
</tr>
<tr>
<td align="right">Title:</td>
<td>
<input type="text" name="title" style="width:400px" value="" />
</td>
</tr>
<tr>
<td align="right">Date:</td>
<td>
<input type="text" name="date" style="width:400px" value="" />
</td>
</tr>
<tr>
<td colspan="2" align="right">
<input type="button" value="Cancel">
<input type="submit" name="action" value="Upload" />
</td>
</tr>
</table>
I want the value to have a <TMPL_VAR> variable in it.
You use it the same way you'd use a template variable anywhere else:
<input type="text" name="date" style="width:400px" value="<TMPL_VAR NAME=date>" />
Yeah, it's ugly and it breaks your HTML validator. Which is one of the many reasons why I like Template Toolkit better.

Align tops of two tables

There are two tables on my page and they appear side-by-side. I want to align the tops of the two tables. How to do that?
Edited:
<body>
<table id="main" cols="2">
<tr>
<td>
<Form id="frmNewEntry" method="post" action="insert_listing.php">
<table id="tblEntry" cols="3" style="border-color:lightblue; border-style:solid;">
<tr><td colspan="3" bgcolor="lightblue" align="center"><strong>Real-Time Vacancy Entry</strong></td></tr>
<tr><td>Date:</td><td><input id="LDate" name="LDate" type="text" size="20" maxlength="11"/>[Select Date from the Calendar Control]
<script type="text/javascript">
calendar.set("LDate");
</script></td>
<td>
<table>
<tr>
<td rowspan="6">
<!-- <iframe src="show_db_vacancy_entries.php" height="800px" width="300px" bordercolor="cyan">
</iframe> -->
</td>
</tr>
</table>
</td>
</tr>
<tr><td>Places:</td><td><input id="Places" name="Places" type="text" size="35" maxlength="30" onblur="this.value=MakeInitialCapital(this.value);"></td></tr>
<tr><td>Company:</td><td><input id="Company" name="Company" type="text" size="50" onblur="this.value=MakeInitialCapital(this.value);">
<!-- <input type="button" value="Make Initial Capital" align="left" onclick="this.value=MakeInitialCapital(this.value);"></tr> -->
<tr><td>Designation:</td><td><input id="Designation" name="Designation" type="text" size="50" onblur="this.value=MakeInitialCapital(this.value);"></td></tr>
<tr><td>Project Details:</td><td><textarea id="ProjectDetails" name="ProjectDetails" cols="100" rows="10"></textarea></td></tr>
<tr><td>Desired Candidate:</td><td><textarea id="DesiredCandidate" name="DesiredCandidate" rows="3" cols="100"></textarea> <br></td></tr>
<tr><td>HR Name:</td><td><input id="HRName" name="HRName" type="text" size="50" onblur="this.value=MakeInitialCapital(this.value);"> <br></td></tr>
<tr><td>HR Contact:</td><td><input id="HRContact" name="HRContact" type="text" size="50"> <br></td></tr>
<tr><td>Email:</td><td><input id="Email" name="Email" type="text" size="50"> <br></td></tr>
<tr></tr>
<tr>
<td bgcolor="lightblue">
<input id="Submit" name="Submit" value="Clear" type="button">
</td>
<td bgcolor="lightblue">
<input id="Submit" name="Submit" value="Submit" type="button">
</td>
</tr>
</table>
</Form>
</td>
<td>
<table id="list" cols="2" style="border:none">
<tr>
<td colspan="2" style="border:none">
<iframe src="show_db_vacancy_entries.php" height="800px" style="border:none;">
</iframe>
</td>
</tr>
<tr>
<td align="left">
<input id="Update" name="Update" value="Update" type="button">
</td>
<td align="right">
<input id="Delete" name="Delete" value="Delete" type="button">
</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
as far as i could understand your question: you should use:
<table id="table 1">
<tr>
<td valign="top">....<td>
</tr>
</table>
<table id="table 2">
<tr>
<td valign="top">....<td>
</tr>
</table>
Try This one
<div>
<table id="tbl1" style="float:left"></table>
<table id="tbl2" style="float:left"></table>
</div>