I am using DataTables on a HTML table and would like to hide all select and inputs from the table headings.
I have used this code:
#media print{
th select{
display: none;
}
}
But that didn't work.
One example is, in 1 column I have this as the heading:
<th>
All Businesses
<select name='business' id='business'>
<option value=''>All Businesses...</option>
<option value='Business 1'>Business 1</option>
<option value='Business 2'>Business 2</option>
<option value='Business 3'>Business 3</option>
</select>
</th>
Which when printing looks like this:
Ideally I need a solution that means the select isn't in the TH but is in the same position as it is now (just under the "All Businesses" bit). I say this because DataTables has a visibility column which ends up using everything in the th meaning the business names show up in that as well.
Thanks!
This is the full code for the table head:
$label_to_name = array();
$tableRes = $db->query("SELECT * from staff_fields");
$table = "<table class='table' id='table'><thead><tr><th>All Businesses<select name='business' id='business'><option value=''>All Businesses...</option><option value='Business 1'>Business 1</option><option value='Business 2'>Business 2</option><option value='Business 3'>Business 3</option></select></th>";
$trowss = $tableRes->fetchAll(PDO::FETCH_ASSOC);
$js = "";
$i = 1;
foreach($trowss as $trows){
if($trows['type'] == "yesno"){
$search_option = "<select id='".$trows['name']."' name='".$trows['name']."'><option value=''>Select Filter...<option value='Yes'>Yes</option><option value='No'>No</option></select>";
$js .= "var ".$trows['name']."index = ".$i.";
$('#".$trows['name']."').on('change',function(){
oTable.columns(".$trows['name']."index).search($(this).val()).draw();
});
";
}else{
$search_option = "<input type='text' name='".$trows['name']."' id='".$trows['name']."' placeholder='Type to Search...'>";
$js .= "var ".$trows['name']."index = ".$i.";
$('#".$trows['name']."').on('input',function(){
oTable.columns(".$trows['name']."index).search($(this).val()).draw();
});
";
}
$table .= "<div class='table_heading'><th>".$trows['label']."</th>".$search_option."</div>";
$label_to_name[$trows['label']] = $trows['name'];
$i++;
}
$table .= "</tr></thead><tbody>";
HTML Output:
<table class='table' id='table'>
<thead>
<tr>
<th>
All Businesses
<select name='business' id='business'>
<option value=''>All Businesses...</option>
<option value='Business 1'>Business 1</option>
<option value='Business 2'>Business 2</option>
<option value='Business 3'>Business 3</option>
</select>
</th>
<th>First Name<input type='text' name='first_name1459057776924' id='first_name1459057776924' placeholder='Type to Search...'></th>
<th>Last Name<input type='text' name='last_name1459057788088' id='last_name1459057788088' placeholder='Type to Search...'></th>
<th>Job Title<input type='text' name='job_title1459057796608' id='job_title1459057796608' placeholder='Type to Search...'></th>
<th>
Proof of Age on File
<select id='proof_of_age_on_file1459057805910' name='proof_of_age_on_file1459057805910'>
<option value=''>Select Filter...
<option value='Yes'>Yes</option>
<option value='No'>No</option>
</select>
</th>
<th>Date of Birth<input type='text' name='date_of_birth1459057814082' id='date_of_birth1459057814082' placeholder='Type to Search...'></th>
<th>Start Date<input type='text' name='start_date1459057824504' id='start_date1459057824504' placeholder='Type to Search...'></th>
<th>
Signed Contract in Place
<select id='signed_contract_in_place1459057835607' name='signed_contract_in_place1459057835607'>
<option value=''>Select Filter...
<option value='Yes'>Yes</option>
<option value='No'>No</option>
</select>
</th>
<th>
DBS on File
<select id='dbs_on_file1459057844504' name='dbs_on_file1459057844504'>
<option value=''>Select Filter...
<option value='Yes'>Yes</option>
<option value='No'>No</option>
</select>
</th>
<th>DBS Date<input type='text' name='dbs_date1459057856098' id='dbs_date1459057856098' placeholder='Type to Search...'></th>
<th>
References Received
<select id='references_received1459057869650' name='references_received1459057869650'>
<option value=''>Select Filter...
<option value='Yes'>Yes</option>
<option value='No'>No</option>
</select>
</th>
<th>
Payroll Info Given to HO
<select id='payroll_information_given_to_ho1459057881692' name='payroll_information_given_to_ho1459057881692'>
<option value=''>Select Filter...
<option value='Yes'>Yes</option>
<option value='No'>No</option>
</select>
</th>
<th>Leaving Date<input type='text' name='leaving_date1459057889857' id='leaving_date1459057889857' placeholder='Type to Search...'></th>
<th>
Left
<select id='left1459263499753' name='left1459263499753'>
<option value=''>Select Filter...
<option value='Yes'>Yes</option>
<option value='No'>No</option>
</select>
</th>
<th>Next Of Kin (Name, Relationship and Contact Number)<input type='text' name='next_of_kin1459342113034' id='next_of_kin1459342113034' placeholder='Type to Search...'></th>
<th>Medical Condition<input type='text' name='medical_condition1459342141909' id='medical_condition1459342141909' placeholder='Type to Search...'></th>
</tr>
</thead>
The problem that you have is not with your css, but with your HTML.
You should make sure that your <th> tag is inside a <table> <tr> tag, otherwise the browser will change your structure and the #media print will not apply.
You can always check that your html structure is valid using the w3 validator.
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Test</title>
<style type="text/css">
#media print {
th select {
display: none;
}
}
</style>
</head>
<body>
<table>
<tr>
<th>
All Businesses
<select name='business' id='business'>
<option value=''>All Businesses...</option>
<option value='Business 1'>Business 1</option>
<option value='Business 2'>Business 2</option>
<option value='Business 3'>Business 3</option>
</select>
</th>
</tr>
</table>
</body>
</html>
Related
i am using https://developer.snapappointments.com/bootstrap-select/examples/
its working fine in view but when i using this in Jquery below code its not working. help me to fix this.
view code
<table id="tableAppointment" style="background-color:powderblue;">
<tr>
<th style="text-align:center;" colspan="1">NAME</th>
<th style="text-align:center;" colspan="1">HSN/SAC</th>
<th><i class="glyphicon glyphicon-plus">ADD</i></th>
</tr>
<tr>
<td >
<select class="selectpicker" data-live-search="true" name="product_name[]">
<option value=""></option>
#foreach ($addnewitem as $key=>$addnewitems)
<option >{{$addnewitems->product_name}}</option>
#endforeach </select>
</td>
<td >
<select class="selectpicker" data-live-search="true" name="part_no[]">
<option value=""></option>
#foreach ($addnewitem as $key=>$addnewitems)
<option >{{$addnewitems->part_no}}</option>
#endforeach </select>
</td>
<td><i class="glyphicon glyphicon-remove">REMOVE</i></td>
</tr>
</table>
<script type="text/javascript">
$('.addRow').on('click',function(){
addRow();
});
function addRow()
{
var tr='<tr>'+
'<td ><select class="selectpicker" data-live-search="true" name="product_name[]"><option
value=""></option> #foreach($addnewitem as $key=>$addnewitems)<option >{{$addnewitems->product_name}}</option>#endforeach </select></td>'+
'<td ><select class="selectpicker" data-live-search="true" name="part_no[]"><option value=""></option> #foreach($addnewitem as $key=>$addnewitems)<option >{{$addnewitems->part_no}}</option>#endforeach </select></td>'+
'<td><i class="glyphicon glyphicon-remove">REMOVE</i></td>'+
'</tr>';
$('tbody').append(tr);
};
$('.remove').live('click',function(){
var last=$('tbody tr').length;
if(last==1){
alert("you can not remove last row");
}
else{
$(this).parent().parent().remove();
}
});
</script>
after click $('.addRow') u need to re-render selectpicker
You can force a re-render of the bootstrap-select ui with the render method. This is useful if you programatically change any underlying values that affect the layout of the element.
$(document).on('click','.addRow',function(){
addRow();
$('.selectpicker').selectpicker('refresh');
});
How i can add input field on specific selection in depended drop down
i want to show input field when user select other option in drop down list.
Like when someone want to add something more that is not in the list he can add manually.
List will be too big I'm just showing the first three categorizes
Here is my code:
#extends('layout/header')
#include('layout/sidebar')
<div id="page-wrapper">
<div class="container-fluid">
<div class="row">
<div class="col-md-12">
<h1 class="motetreports_heading"></h1>
{{-- first sequnce --}}
<form action="/atgard" method="post">
#csrf
<table width="50%" border="0" cellspacing="0" cellpadding="5">
<tr>
<td width="41%" align="right" valign="middle">Category1 :</td>
<td width="59%" align="left" valign="middle">
<select name="category1" id="category1">
<option value="">Select Category1</option>
<option value="home_ware">Home Ware</option>
<option value="education">Education</option>
<option value="books">Other</option>
</select>
</td>
</tr>
<tr>
<td align="right" valign="middle">Category2 :</td>
<td align="left" valign="middle">
<select disabled="disabled" class="subcat" id="category2" name="category2">
<option value>Select Category2</option>
<!-- Home Ware -->
<optgroup data-rel="home_ware">
<option value="air-conditioners_coolers">Air-Conditioners/Coolers</option>
<option value="audio-video">Audio/Video</option>
<option value="beddings">Beddings</option>
<option value="camera">Camera</option>
<option value="cell-phones">Cell Phones</option>
</optgroup>
<!-- Education -->
<optgroup data-rel="education">
<option value="Colleges">Colleges</option>
<option value="Institutes">Institutes</option>
<option value="Schools">Schools</option>
<option value="Tuitions">Tuitions</option>
<option value="Universities">Universities</option>
</optgroup>
<!-- Books -->
<optgroup data-rel="books">
<option value="College Books">College Books</option>
<option value="Engineering">Engineering</option>
<option value="Magazines">Magazines</option>
<option value="Medicine">Medicine</option>
<option value="References">References</option>
</optgroup>
</select>
</td>
</tr>
<tr>
<td align="right" valign="middle">Category3 :</td>
<td align="left" valign="middle">
<select disabled="disabled" class="subcat" id="category3" name="category3">
<option value>Select Category3</option>
<!-- Home Ware -->
<optgroup data-rel="home_ware">
<option value="foo1">category3 home ware 1</option>
<option value="foo2">category3 home ware 2</option>
</optgroup>
<!-- Education -->
<optgroup data-rel="education">
<option value="foo3">category3 Education 1</option>
<option value="foo4">category3 Education 2</option>
</optgroup>
<!-- Books -->
<optgroup data-rel="books">
<option value="foo5">category3 Books 1</option>
<option value="foo6">category3 Books 2</option>
</optgroup>
</select>
</td>
</tr>
</table>
<button type="submit" style="width: 100px;" class="btn btn-primary">Skicka</button>
</form>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script type="text/javascript">
$(function(){
var $cat = $("#category1"),
$subcat = $(".subcat");
var optgroups = {};
$subcat.each(function(i,v){
var $e = $(v);
var _id = $e.attr("id");
optgroups[_id] = {};
$e.find("optgroup").each(function(){
var _r = $(this).data("rel");
$(this).find("option").addClass("is-dyn");
optgroups[_id][_r] = $(this).html();
});
});
$subcat.find("optgroup").remove();
var _lastRel;
$cat.on("change",function(){
var _rel = $(this).val();
if(_lastRel === _rel) return true;
_lastRel = _rel;
$subcat.find("option").attr("style","");
$subcat.val("");
$subcat.find(".is-dyn").remove();
if(!_rel) return $subcat.prop("disabled",true);
$subcat.each(function(){
var $el = $(this);
var _id = $el.attr("id");
$el.append(optgroups[_id][_rel]);
});
$subcat.prop("disabled",false);
});
});
</script>
</div>
</div>
</div>
<!-- /.container-fluid -->
</div>
<!-- /#page-wrapper -->
</div>
<!-- /#wrapper -->
#include('layout/footer')
I think you should put an document.getElementById("theselectid").selected = true; or something that will indicate that it was checked, then: inside if, document.getElementById("theidofinput").disabled = false;document.getElementById("theidofinput").style.opacity = 1.0; or something.
I'm looking for a way to target my value option page 1 of X. It seems this is defined as a value option. Can i just target the div class to move it down the page slightly to align with another element?
Html:
<div class="pager">
<form class="awpcp-pagination-form" method="get">
<table>
<tbody>
<tr>
<td>1</td>
<td>
<select name="results">
<option value="5">5</option>
<option value="10" selected="selected">10</option>
<option value="20">20</option>
<option value="30">30</option>
<option value="40">40</option>
<option value="50">50</option>
<option value="60">60</option>
<option value="70">70</option>
<option value="80">80</option>
<option value="90">90</option>
<option value="100">100</option>
<option value="500">500</option>
</select>
</td>
</tr>
</tbody>
</table>
</form>
Page: https://adsler.co.uk/browse-adsler/
Your question is quite undefined, but assuming you want a way to target the element and based on the provide HTML this are ways to target the specific HTML elements.
/* Pagination container */
.awpcp-pagination-form {
outline: 1px solid purple;
padding: 10px;
}
/* Only the selection within container */
.awpcp-pagination-form select {
outline: 1px solid blue;
}
/* or */
select[name="results"] {
background: red;
}
<div class="pager">
<form class="awpcp-pagination-form" method="get">
<table>
<tbody>
<tr>
<td>1</td>
<td>
<select name="results">
<option value="5">5</option>
<option value="10" selected="selected">10</option>
<option value="20">20</option>
<option value="30">30</option>
<option value="40">40</option>
<option value="50">50</option>
<option value="60">60</option>
<option value="70">70</option>
<option value="80">80</option>
<option value="90">90</option>
<option value="100">100</option>
<option value="500">500</option>
</select>
</td>
</tr>
</tbody>
</table>
</form>
If I understand your question you can do this using margins with css.
.divclass{
margin-top: 2%;
}
Something like that might work. You can also try using Flex-Box or Grid.
Good luck!
I've just created an image and am using it as a submit button:
<input name="submit" id="submit" type="image" src="http://www.workbooks.com/sites/default/files/image/button.png" width="170" height="40" value="Sign up" class="loudbutton" />
However the image is larger than it should be, it's flowing outside the images border (not css).
You can see the example:
All the blue outside of the black border should not show!
Does anyone have any idea what's going on?
You can see the full HTML at: http://jsfiddle.net/9vsLyhwg/
Thanks
Remove padding: 7px; from .loudbutton, .quietbutton {
#submit {
padding:0;
}
<!doctype html>
<body>
<html lang="en">
<head>
<meta charset="utf-8">
<link href="https://secure.workbooks.com/resources/=QzM/workbooks_signup_form.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="https://secure.workbooks.com/javascripts/jquery.js"></script>
<script type="text/javascript" src="https://secure.workbooks.com/javascripts/jquery_validate.js"></script>
<title>Signup to Workbooks</title>
<script type="text/javascript">
$(window).load(function() { $("#spinner").fadeOut("fast"); });
</script>
</head><br>
<body>
<div id="spinner"></div>
<div id="wrap">
<div id="main">
<div id="main-body">
<form id="customer_signup_form" method="post">
<input type="hidden" name="edition" id="edition" value="trial"/>
<input name="nickname" id="nickname" class="hide"/>
<table>
<tr>
<td>
<label for="first_name">First Name</label>
</td>
<td>
<input name="first_name" id="first_name" class="required" minlength="2" size="40"/>
</td>
</tr>
<tr>
<td>
<label for="last_name">Last Name</label>
</td>
<td>
<input name="last_name" id="last_name" class="required" minlength="2" size="40"/>
</td>
</tr>
<tr>
<td>
<label for="email">Email</label>
</td>
<td>
<input name="email" id="email" class="required email" size="40"/>
</td>
</tr>
<tr>
<td>
<label for="confirm_email">Email (Confirm)</label>
</td>
<td>
<input name="confirm_email" id="confirm_email" class="required email" equalTo='#email' size="40"/>
</td>
</tr>
<tr>
<td>
<label for="job_role">Job Role</label>
</td>
<td>
<select name="job_role" min="1">
<option selected value="0">-- Please select one --</option>
<option value="1775">Business Leader</option>
<option value="1776">Customer Support: Leader</option>
<option value="1777">Customer Support: Team Member</option>
<option value="1778">Finance: Leader</option>
<option value="1779">Finance: Team Member</option>
<option value="1780">HR: Leader</option>
<option value="1781">HR: Team Member</option>
<option value="1782">Individual Contributor</option>
<option value="1783">Industry Analyst</option>
<option value="1784">Investment Analyst</option>
<option value="1785">IT: Leader</option>
<option value="1786">IT: Team Member</option>
<option value="1787">Journalist</option>
<option value="1788">Marketing: Leader</option>
<option value="1789">Marketing: Team Member</option>
<option value="1790">Office Manager / Assistant</option>
<option value="1791">Operations: Leader</option>
<option value="1792">Operations: Team Member</option>
<option value="1793">Procurement Professional</option>
<option value="1794">Purchasing: Leader</option>
<option value="1795">Purchasing: Team member</option>
<option value="1796">Sales: Leader</option>
<option value="1798">Sales: Team Member</option>
</select>
</td>
</tr>
<tr>
<td>
<label for="telephone">Telephone</label>
</td>
<td>
<input name="telephone" id="telephone" class="required" minlength="10" size="40"/>
</td>
</tr>
<tr>
<td>
<label for="number_of_employees">Number of Employees</label>
</td>
<td>
<input name="number_of_employees" id="number_of_employees" class="required integer" pattern="[0-9]*" size="7"/>
</td>
</tr>
<tr>
<td>
<label for="company_name">Company Name</label>
</td>
<td>
<input name="company_name" id="company_name" class="required" minlength="2" size="40"/>
</td>
</tr>
<tr>
<td>
<label for="industry">Industry</label>
</td>
<td>
<select name="industry" min="1">
<option selected value="0">-- Please select one --</option>
<option value="1721">Agriculture, Forestry & Fishing</option>
<option value="1722">Charity</option>
<option value="1723">Construction</option>
<option value="1725">Education & Training</option>
<option value="1726">Energy: B2B</option>
<option value="1727">Energy: B2C</option>
<option value="1728">Energy: Utilities</option>
<option value="2204">Finance: General</option>
<option value="1729">Finance: B2B</option>
<option value="1730">Finance: B2C</option>
<option value="1731">Finance: Investment Banking</option>
<option value="1732">Finance: Retail Banking</option>
<option value="1733">Government: Local</option>
<option value="1734">Government: National</option>
<option value="1735">Government: National, Local</option>
<option value="1736">Health: B2C</option>
<option value="1737">Health: Government</option>
<option value="1738">Health: Social Care</option>
<option value="1739">Hotels & Restaurants</option>
<option value="2205">Insurance: General</option>
<option value="1740">Insurance: B2B</option>
<option value="1741">Insurance: B2C</option>
<option value="1799">IT & Telecommunications: General</option>
<option value="1742">IT & Telecommunications: Hardware</option>
<option value="1743">IT & Telecommunications: Mobile Operators</option>
<option value="1744">IT & Telecommunications: National Carriers</option>
<option value="1745">IT & Telecommunications: Reseller/Integrator</option>
<option value="1746">IT & Telecommunications: Service Provider</option>
<option value="1747">IT & Telecommunications: Software</option>
<option value="1748">IT & Telecommunications: Vendor</option>
<option value="1749">Leisure</option>
<option value="1750">Manufacturing</option>
<option value="1751">Media & Publishing</option>
<option value="1752">Mining & Quarrying</option>
<option value="1755">Real Estate</option>
<option value="1756">Research & Laboratories</option>
<option value="1759">Services: Accounting</option>
<option value="1760">Services: Advertising, Marketing & Event Management</option>
<option value="1762">Services: Consulting</option>
<option value="1763">Services: Engineering, Architecture & Design</option>
<option value="1765">Services: Legal</option>
<option value="2060">Services: Recruitment & HR</option>
<option value="1767">Services: Other</option>
<option value="1768">Services: Personal Services</option>
<option value="1769">Services: Professional Services</option>
<option value="2062">Trade Association & Professional Bodies</option>
<option value="1772">Transport & Logistics</option>
<option value="1773">Water Supply, Sewerage & Waste Management</option>
<option value="1774">Wholesale, Retail & Distribution</option>
</select>
</td>
</tr>
<tr>
<td>
<label for="current_crm">Current CRM</label>
</td>
<td>
<select name="current_crm" min="1">
<option selected value="0">-- Please select one --</option>
<option value="1503">Salesforce.com</option>
<option value="2495">Microsoft Dynamics CRM Cloud</option>
<option value="1042">Microsoft Dynamics CRM On Network</option>
<option value="1232">Sugar CRM</option>
<option value="1052">Sage CRM</option>
<option value="1053">Saleslogix from Infor (ex Sage)</option>
<option value="1234">Netsuite</option>
<option value="1048">Spreadsheets / None</option>
<option value="1054">Custom/In-house</option>
<option value="2059">Other</option>
<option value="1842">Workbooks</option>
<option value="1504">Access Database</option>
<option value="1051">ACT!</option>
<option value="2157">Aderant CRM</option>
<option value="2491">Base CRM</option>
<option value="2100">Bluecube CRM</option>
<option value="1512">Capsule</option>
<option value="2489">CallPro</option>
<option value="2199">CCH Central</option>
<option value="2397">Charitylog</option>
<option value="2409">CiviCRM</option>
<option value="2092">Clarity</option>
<option value="1507">ClickHQ</option>
<option value="2263">Dealmaker (TAS Group)</option>
<option value="1509">Exact</option>
<option value="2099">FileMaker</option>
<option value="2076">FileVision</option>
<option value="2135">Frontline Data</option>
<option value="1043">Goldmine</option>
<option value="1046">Goldvision</option>
<option value="1505">Highrise</option>
<option value="2137">iMIS</option>
<option value="1840">Industry Specific</option>
<option value="1841">Insightly CRM</option>
<option value="2122">Intouch CRM</option>
<option value="1928">IRIS Integra</option>
<option value="2305">Lagan CRM</option>
<option value="2271">Lexis Nexis InterAction</option>
<option value="1237">Link CRM</option>
<option value="1930">Logical Office</option>
<option value="1044">Maximizer</option>
<option value="2505">Membrain</option>
<option value="2513">Method CRM</option>
<option value="1049">MS Outlook BCM</option>
<option value="1236">Myoffice.net</option>
<option value="1537">NetAge</option>
<option value="2146">Nimble CRM</option>
<option value="1983">Officetalk</option>
<option value="2369">OOMI CRM</option>
<option value="1610">Open CRM</option>
<option value="2200">Only Considering Workbooks</option>
<option value="2182">Onyx CRM</option>
<option value="2106">Open Market</option>
<option value="1510">Oracle</option>
<option value="2327">Orchard CRM</option>
<option value="2179">Pivotal CRM</option>
<option value="2156">Progress CRM</option>
<option value="1984">Prospectsoft</option>
<option value="2155">ProTech</option>
<option value="2102">Raisers Edge - Blackbaud</option>
<option value="1047">Really Simple Systems</option>
<option value="2139">Sage - Edition Unknown</option>
<option value="1206">Salesforce.com - Enterprise Edition</option>
<option value="1041">Salesforce.com - Group Edition</option>
<option value="1205">Salesforce.com - Professional Edition</option>
<option value="2121">Salesnet CRM</option>
<option value="1541">SalesNexus</option>
<option value="1444">Salesorder</option>
<option value="1511">SAP</option>
<option value="2181">Saratoga CRM</option>
<option value="2493">Second CRM</option>
<option value="2201">Siebel</option>
<option value="1929">Shuttleworth</option>
<option value="2105">Spirit</option>
<option value="1985">Superoffiice</option>
<option value="1648">Team Scope</option>
<option value="2097">Technique MIS</option>
<option value="2138">ThankQ</option>
<option value="1229">Tracker RMS</option>
<option value="1513">TSG MRM</option>
<option value="2272">Union Square CRM</option>
<option value="1839">VTiger</option>
<option value="2159">Webchise</option>
<option value="1050">WebCRM</option>
<option value="1045">Zoho</option>
</select>
</td>
</tr>
<tr>
<td>
</td>
<td>
<input name="submit" id="submit" type="image" src="http://www.workbooks.com/sites/default/files/image/button.png" width="170" height="40" value="Sign up" class="loudbutton" />
</td>
</tr>
</table>
</form>
<script type="text/javascript">
//<![CDATA[
$(document).ready(function() {
$.extend($.validator.messages, {
min: 'Please choose an option.'
});
$("#customer_signup_form").validate({
submitHandler: function(form) {
$('#submit').attr('disabled', 'disabled').attr('value', 'Registering. Please wait...');
document.body.style.cursor = "progress";
form.submit();
}
});
$("#customer_first_name").focus();
});
//]]>
</script>
</div>
</div>
</div>
</body>
</html>
In your workbooks_signup_form.css css file you have the .loudbutton declaration with...
background-color: rgb(79, 111, 163);
Remove that and the overflow color is removed.
you have used this:
.loudbutton, .quietbutton {
color: #FFF;
border-radius: 0.5em;
background-color: #4F6FA3;
border: medium none;
padding: 7px;
margin: 10px 0px;
float: right;
}
remove background-color: #4F6FA3; and you are good to go.
The forms which l have here, have required files to be entered before the submit button. All l need it for the top 'title' list to be required='true'. I know how to do it for each and every of the text forms but unsure how to position the code for an options choice list.
Cheers guys.
Please take a look at the jsfiddle l have created for this:
http://jsfiddle.net/New_to_Websites/5A4vS/#run
Code:
<script language="javascript">
var sa_sent_text = 'Thank you for contacting us. We will get back to you soon.';
function sendme() {
alert(sa_sent_text);
document.getElementById("name").value = "";
document.getElementById("message").value = "";
document.getElementById("subject").value = "";
document.getElementById("email").value = "";
return false;
}
</script>
<div id="sa_contactdiv">
<form name=sa_htmlform style="margin:0px" onsubmit="return sendme();">
<table>
<tr>
<td>Title:
<br>
<select name="title" size="1">
<option value="Mr.">Mr.</option>
<option value="Mrs.">Mrs.</option>
<option value="Miss">Miss</option>
<option value="Ms.">Ms.</option>
<option value="Dr.">Dr.</option>
<option value="Prof.">Prof.</option>
<option value="Other">Other</option>
</select>
</td>
</tr>
<tr>
<td>Name:
<br>
<input type="text" id="name" name="name" />
</td>
</tr>
<tr>
<td>E-mail Address: <span style="color:#D70000">*</span>
<br>
<input type="text" id="email" name="email" required="true" />
</td>
</tr>
<tr>
<td>Subject: <span style="color:#D70000">*</span>
<br>
<input type="text" id="subject" name="subject" required="true" />
</td>
</tr>
<tr>
<td>Message: <span style="color:#D70000">*</span>
<br>
<textarea name="message" id="message" cols="42" rows="9" required="true"> </textarea>
</td>
</tr>
<tr>
<td>
<input type="submit" value="Send Message" style="font-weight:bold">
</td>
</tr>
</table>
</form>
</div>
This should work:
<select name="title" size="1" required aria-required=”true”>
<option value="">Please Choose</option>
<option value="Mr.">Mr.</option>
<option value="Mrs.">Mrs.</option>
<option value="Miss">Miss</option>
<option value="Ms.">Ms.</option>
<option value="Dr.">Dr.</option>
<option value="Prof.">Prof.</option>
<option value="Other">Other</option>
</select>
If you have an option with a empty value as default, the required attribute works.
Working Fiddle
The required attribute is a boolean attribute. When specified, the user will be required to select a value before submitting the form.
If a select element has a required attribute specified, does not have a multiple attribute specified, and has a display size of 1; and if the value of the first option element in the select element's list of options (if any) is the empty string, and that option element's parent node is the select element (and not an optgroup element), then that option is the select element's placeholder label option.
Quoted from http://dev.w3.org/html5/spec-author-view/the-select-element.html
Try this
<td>Title:<span style="color:#D70000">*</span>
<br>
<select name="title" size="1" required="true">
<option value=""></option>
<option value="Mr.">Mr.</option>
<option value="Mrs.">Mrs.</option>
<option value="Miss">Miss</option>
<option value="Ms.">Ms.</option>
<option value="Dr.">Dr.</option>
<option value="Prof.">Prof.</option>
<option value="Other">Other</option>
</select>