Delete dynamically created rows with jquery and bind / update cash totals - javascript

Not able to delete rows created dynamically. .add-row will create the dynamic row but the .delete will not remove it. the initial .item-row will however execute the click event and remove that row.
the click event never seems to fire on the added rows?
<form action="insert.php" id="testinsert" method="POST">
<input type="submit" value="Submit" />
</form>
<!--div class="font-effect-shadow-multiple">This is a font effect!<div-->
<div id="page-wrap">
<textarea id="header">INVOICE</textarea>
<div id="identity">
<div form ="testinsert" name="business-address" id="business-address">
<span id="cmtext">Fix it Guy </span><br>
43150 Your Drive<br>
Potomac City, MD 20901<br>
Phone: (301) 555-5580</div>
<div id="logo">
<div id="logoctr">
Change Logo
Save
|
Delete Logo
Cancel
</div>
<div id="logohelp">
<input id="imageloc" type="text" size="50" value="" /><br />
(max width: 540px, max height: 100px)
</div>
<img id="image" src="images/CM_LOGO.JPG" alt="logo" />
</div>
</div>
<div style="clear:both"></div>
<div id="customer">
<div class="container">
<div class="space"></div>
<!--
<textarea form ="testinsert" name="customer" id="customer-title">Customer Name</textarea>
-->
<textarea form ="testinsert" name="address" id="address-title">Customer Invoices</textarea>
<textarea form ="testinsert" name="address1" id="address-one"></textarea>
<!--
<textarea form ="testinsert" name="address2" id="address-two">..</textarea>
<textarea form ="testinsert" name="address3" id="address-three"></textarea>
-->
</div>
<img src="http://www.jeffbarclay.com/invoice/images/green-plus.png" class="lookup-cust-plus" id="look"/>
<table id="meta">
<tr>
<td class="meta-head">Invoice #</td>
<td><textarea form ="testinsert" id="invoice_num" name="invoice">20170130</textarea></td>
</tr>
<tr>
<td form ="testinsert" name="date" class="meta-head">Date</td>
<td><textarea id="date">Janruary 30, 1960</textarea></td>
</tr>
<tr>
<td class="meta-head">Amount Due</td>
<td><div class="due">$0.00</div></td>
</tr>
</table>
</div>
<table id="items">
<tr>
<th>Item</th> <th>Description</th> <th>Unit Cost</th> <th>Quantity</th> <th>Price</th>
</tr>
<tr class="item-row">
<td class="item-name"><div class="delete-wpr"><textarea form ="testinsert" name="item_name[]"></textarea>
<a class="delete" href="javascript:;" title="Remove row">X</a>
<a class="add-product" href="javascript:;" title="Add Product">A</a>
</div></td>
<td class="description"><textarea form ="testinsert" name="item_desc[]"></textarea></td>
<td><textarea class="cost" form ="testinsert" name="item_cost[]"></textarea></td>
<td><textarea class="qty" form ="testinsert" name="item_qty[]"></textarea></td>
<td><span class="price" form ="testinsert" name="item_price[]"></span></td>
</tr>
<tr id="hiderow">
<td colspan="5">
<img src="http://www.jeffbarclay.com/invoice/images/rows.png" width="30px" height="auto" id="addrow" href="javascript:;" title="Add a row"/>
<img src="http://www.jeffbarclay.com/invoice/images/products.png" width="30px" height="auto" href="javascript:;" id="fill-invoice" class="add-invoice" title="Add Invoice"/>
<img src="http://www.jeffbarclay.com/invoice/images/products.png" width="30px" height="auto" href="javascript:;" id="recall_product" class="recall-product" title="Recall Product"/>
</td>
</tr>
<tr>
<td colspan="2" class="blank"> </td>
<td colspan="2" class="total-line">Subtotal</td>
<td class="total-value"><div id="subtotal">$0.00</div></td>
</tr>
<tr>
<td colspan="2" class="blank"> </td>
<td colspan="2" class="total-line">Total</td>
<td class="total-value"><div id="total">$0.00</div></td>
</tr>
<tr>
<td colspan="2" class="blank"> </td>
<td colspan="2" class="total-line">Amount Paid</td>
<td class="total-value"><textarea id="paid">$0.00</textarea></td>
</tr>
<tr>
<td colspan="2" class="blank"> </td>
<td colspan="2" class="total-line balance">Balance Due</td>
<td class="total-value balance"><div id="owed" class="due">$0.00</div></td>
</tr>
</table>
<input type="hidden" form ="testinsert" name="xdate" id="xdate"></input>
<input type="hidden" form ="testinsert" name="sales" id="sales"></input>
<input type="hidden" form ="testinsert" name="owed" id="owed"></input>
<input type="hidden" form ="testinsert" name="deducted" id="deducted"></input>
<input type="hidden" form ="testinsert" name="auto_num" id="auto_num"></input>
<div id="terms">
<h5>Terms</h5>
<textarea>NET 30 Days. Finance Charge of 1.5% will be made on unpaid balances after 30 days.</textarea>
</div>
</div>
<!--Contact Form -->
<div id="store_customer_div">
<form class="form" action="insert_customer.php" id="contact" method="POST">
<img src="images/button_cancel.png" class="img" id="cancel"/>
<h3>Store Customers</h3>
<hr/><br/>
<label>Customer Name: <span>*</span></label>
<br/>
<input type="text" id="name" placeholder="Name" name="customer"/><br/>
<br/>
<label>Email: <span>*</span></label>
<br/>
<input type="text" id="email" placeholder="Email" name="email"/><br/>
<br/>
<label>Contact No: <span></span></label>
<br/>
<input type="text" id="contactno" placeholder="10 digit Mobile no." name="contact"/><br/>
<br/>
<label>Address 1: <span></span></label>
<br/>
<input type="text" id="address1" placeholder="address1" name="address1"/><br/>
<br/>
<label>Address 2: <span></span></label>
<br/>
<input type="text" id="address2" placeholder="address2" name="address2"/><br/>
<br/>
<label>Address 3: <span></span></label>
<br/>
<input type="text" id="address3" placeholder="address3" name="address3"/><br/>
<br/>
<input type="button" id="send" value="Store Customer"/><br/>
</form>
</div>
<!--Product Form -->
<div id="store_product_div">
<form class="form" action="insert_products.php" id="form_product" method="POST">
<img src="images/button_cancel.png" class="img" id="p_cancel"/>
<h3>Store Products</h3>
<hr/><br/>
<label>Product Name: <span>*</span></label>
<br/>
<input type="text" id="p_name" placeholder="Product Name" name="product"/>
<br/>
<label>Rate: <span>*</span></label>
<br/>
<input type="text" id="p_rate" placeholder="Sales Price $" name="rate"/><br/>
<br/>
<label>Cost: <span>*</span></label>
<br/>
<input type="text" id="p_cost" placeholder="Cost" name="cost"/><br/>
<br/>
<label>Taxable: <span>*</span></label>
<br/>
<input type="text" id="p_tax" placeholder="Taxable" name="taxable"/><br/>
<br/>
<label>Description: <span>*</span></label>
<br/>
<input type="text" id="p_desc" placeholder="Description" name="desc"/><br/>
<br/>
<input type="submit" id="send" value="Store Product"/><br/>
</form>
</div>
<div id="customer_div">
<form class="form" action="customer_fill.php" id="contact" method="GET">
<img src="images/button_cancel.png" class="img" id="cancel"/>
<h2>Customer List</h2>
<ul id="dropdown" name="ddname"></ul>
</form>
</div>
<div id="product_div">
<form class="form" action="product_fill.php?action=fill" id="contact" method="GET">
<img src="images/button_cancel.png" class="img" id="cancel"/>
<h2>Product List</h2>
<ul id="ddproduct" name="ddproductname"></ul>
</form>
</div>
<div id="invoice_div">
<form class="form" action="invoice_fill.php" id="contact" method="GET">
<img src="images/button_cancel.png" class="img" id="cancel"/>
<h2>Invoice List</h2>
<ul id="ddinvoice" name="ddinvoicename"></ul>
</form>
</div>
JS:
see: https://jsfiddle.net/xzt1krqn/
$(".delete").on('click', function() {
$(this).parents('.item-row').remove();
update_total();
if ($(".delete").length < 2) $(".delete").hide();
});

You have to use document selector for selecting dynamically created elements.
$(document).on('click','.delete',function(){
$(this).parents('.item-row').remove();
update_total();
if ($(".delete").length < 2) $(".delete").hide();
});

Related

How to get JSON data from HTML form with backbone js

I am creating a dynamic form in a Backbone.js view. I want to get all the JSON data from the form in my view without using jQuery. Is there any way to get the data?
For example: When You check the checkbox, I only want the data for the checked field.
<table class="table">
<thead>
<tr>
<th></th>
<th>{{labels.selectImage}}</th>
<th>{{labels.nameVisibleToShop}}</th>
<th>{{labels.sourceCode}}</th>
<th>{{labels.pricePerItem}}</th>
</tr>
</thead>
<tbody>
<tr id ="school-imageId-{{categoryImage.cmsId}}">
<td><input type="checkbox" class="form-control mz-embrodiary-enable"/></td>
<td><img width="40px" src="{{categoryImage.imageUrl}}" /></td>
<td>
<input type="text" name="name" class="form-control" placeholder="{{labels.nameVisibleToShop}}" disabled/>
<span class="mz-validationmessage hidden" data-mz-validationmessage-for="name">{{labels.genericRequired}}</span>
</td>
<td>
<input type="text" name="sourceCode" class="form-control" placeholder="{{labels.sourceCode}}" disabled/>
<span class="mz-validationmessage hidden" data-mz-validationmessage-for="name">{{labels.genericRequired}}</span>
</td>
<td>
<input type="text" name="price" class="form-control" placeholder="{{labels.enterPrice}}" disabled/>
<span class="mz-validationmessage hidden" data-mz-validationmessage-for="price">{{labels.genericRequired}}</span>
</td>
</tr>
<tr id ="school-imageId-{{categoryImage.cmsId}}">
<td><input type="checkbox" class="form-control mz-embrodiary-enable"/></td>
<td><img width="40px" src="{{categoryImage.imageUrl}}" /></td>
<td>
<input type="text" name="name" class="form-control" placeholder="{{labels.nameVisibleToShop}}" disabled/>
<span class="mz-validationmessage hidden" data-mz-validationmessage-for="name">{{labels.genericRequired}}</span>
</td>
<td>
<input type="text" name="sourceCode" class="form-control" placeholder="{{labels.sourceCode}}" disabled/>
<span class="mz-validationmessage hidden" data-mz-validationmessage-for="name">{{labels.genericRequired}}</span>
</td>
<td>
<input type="text" name="price" class="form-control" placeholder="{{labels.enterPrice}}" disabled/>
<span class="mz-validationmessage hidden" data-mz-validationmessage-for="price">{{labels.genericRequired}}</span>
</td>
</tr>
<tr id ="school-imageId-{{categoryImage.cmsId}}">
<td><input type="checkbox" class="form-control mz-embrodiary-enable"/></td>
<td><img width="40px" src="{{categoryImage.imageUrl}}" /></td>
<td>
<input type="text" name="name" class="form-control" placeholder="{{labels.nameVisibleToShop}}" disabled/>
<span class="mz-validationmessage hidden" data-mz-validationmessage-for="name">{{labels.genericRequired}}</span>
</td>
<td>
<input type="text" name="sourceCode" class="form-control" placeholder="{{labels.sourceCode}}" disabled/>
<span class="mz-validationmessage hidden" data-mz-validationmessage-for="name">{{labels.genericRequired}}</span>
</td>
<td>
<input type="text" name="price" class="form-control" placeholder="{{labels.enterPrice}}" disabled/>
<span class="mz-validationmessage hidden" data-mz-validationmessage-for="price">{{labels.genericRequired}}</span>
</td>
</tr>
</tbody>
</table>

Send data out of visible form only

I have two divs containing same input fields. When I enter the vales in both the div fields, all the values get submitted. what I want is, only the value of selected div (using radio button) should pass. Any help will be appreciated :-)
$(document).ready(function() {
console.log('called');
$('input[type=radio][name=cancel_policy]').change(function() {
if (this.value == '0') {
$("#fixedPolicyDiv").css("display", "block");
$("#percentagePolicyDiv").css("display", "none");
$("#percentagePolicyDiv").get(0).reset();
} else if (this.value == '1') {
$("#fixedPolicyDiv").css("display", "none");
$("#fixedPolicyDiv").get(0).reset();
$("#percentagePolicyDiv").css("display", "block");
}
});
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<label class="custom-control custom-control-primary custom-radio">
<input class="custom-control-input" type="radio" name="cancel_policy" value="0"> <span class="custom-control-indicator"></span>
<span class="custom-control-label">Fixed price</span>
</label>
<label class="custom-control custom-control-primary custom-radio">
<input class="custom-control-input" type="radio" name="cancel_policy" value="1"> <span class="custom-control-indicator"></span>
<span class="custom-control-label">Percentage wise</span>
</label>
<div id="fixedPolicyDiv" style="display:none;">
<div class="form-group">
<div class="col-lg-11 col-lg-offset-1">
<div class="table-responsive">
<table class="table" id='cancel_tbl'>
<tr>
<td width='30%'>Days</td>
<td width='30%'>Amount</td>
<td> </td>
</tr>
<tr>
<td>
<input type="number" name="cancel_policy_days[]" class="form-control" placeholder="days" value="<?= set_value('cancel_policy_days[]') ?>" required="required" />
</td>
<td>
<input type="number" name="cancel_policy_amount[]" class="form-control" placeholder="cancellation amount" value="<?= set_value('cancel_policy_amount[]') ?>" required="required" />
</td>
<td> </td>
</tr>
<tr>
<td colspan="6" align="center">
<input type="button" value="Add More" id="cancel_addmorebtn1" class="btn btn-outline-info">
</td>
</tr>
</table>
</div>
</div>
</div>
</div>
<div id="percentagePolicyDiv" style="display:none;">
<div class="form-group">
<div class="col-lg-11 col-lg-offset-1">
<div class="table-responsive">
<table class="table" id='cancel_tb2'>
<tr>
<td width='30%'>Days</td>
<td width='30%'>Percentage</td>
<td> </td>
</tr>
<tr>
<td>
<input type="number" name="cancel_policy_days[]" class="form-control" placeholder="days" value="<?= set_value('cancel_policy_days[]') ?>" required="required" />
</td>
<td>
<input type="number" name="cancel_policy_amount[]" class="form-control" placeholder="cancellation percentage" value="<?= set_value('cancel_policy_amount[]') ?>" required="required" />
</td>
<td> </td>
</tr>
<tr>
<td colspan="6" align="center">
<input type="button" value="Add More" id="cancel_addmorebtn2" class="btn btn-outline-info">
</td>
</tr>
</table>
</div>
</div>
</div>
</div>
You can add the disabled property to the inputs you do not want to sent.
for exemple :
$("#percentagePolicyDiv").find('input').prop('disabled');
If reset() is not only JS method you accept, we can make it with setting value of input fields such way:
$(document).ready(function() {
console.log('called');
$('input[type=radio][name=cancel_policy]').change(function() {
if (this.value == '0') {
$("#percentagePolicyDiv").find('input').val('');
$("#fixedPolicyDiv").css("display", "block");
$("#percentagePolicyDiv").css("display", "none");
} else if (this.value == '1') {
$("#fixedPolicyDiv").find('input').val('');
$("#fixedPolicyDiv").css("display", "none");
$("#percentagePolicyDiv").css("display", "block");
}
});
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<label class="custom-control custom-control-primary custom-radio">
<input class="custom-control-input" type="radio" name="cancel_policy" value="0"> <span class="custom-control-indicator"></span>
<span class="custom-control-label">Fixed price</span>
</label>
<label class="custom-control custom-control-primary custom-radio">
<input class="custom-control-input" type="radio" name="cancel_policy" value="1"> <span class="custom-control-indicator"></span>
<span class="custom-control-label">Percentage wise</span>
</label>
<div id="fixedPolicyDiv" style="display:none;">
<div class="form-group">
<div class="col-lg-11 col-lg-offset-1">
<div class="table-responsive">
<table class="table" id='cancel_tbl'>
<tr>
<td width='30%'>Days</td>
<td width='30%'>Amount</td>
<td> </td>
</tr>
<tr>
<td>
<input type="number" name="cancel_policy_days[]" class="form-control" placeholder="days" value="<?= set_value('cancel_policy_days[]') ?>" required="required" />
</td>
<td>
<input type="number" name="cancel_policy_amount[]" class="form-control" placeholder="cancellation amount" value="<?= set_value('cancel_policy_amount[]') ?>" required="required" />
</td>
<td> </td>
</tr>
<tr>
<td colspan="6" align="center">
<input type="button" value="Add More" id="cancel_addmorebtn1" class="btn btn-outline-info">
</td>
</tr>
</table>
</div>
</div>
</div>
</div>
<div id="percentagePolicyDiv" style="display:none;">
<div class="form-group">
<div class="col-lg-11 col-lg-offset-1">
<div class="table-responsive">
<table class="table" id='cancel_tb2'>
<tr>
<td width='30%'>Days</td>
<td width='30%'>Percentage</td>
<td> </td>
</tr>
<tr>
<td>
<input type="number" name="cancel_policy_days[]" class="form-control" placeholder="days" value="<?= set_value('cancel_policy_days[]') ?>" required="required" />
</td>
<td>
<input type="number" name="cancel_policy_amount[]" class="form-control" placeholder="cancellation percentage" value="<?= set_value('cancel_policy_amount[]') ?>" required="required" />
</td>
<td> </td>
</tr>
<tr>
<td colspan="6" align="center">
<input type="button" value="Add More" id="cancel_addmorebtn2" class="btn btn-outline-info">
</td>
</tr>
</table>
</div>
</div>
</div>
</div>
Otherwise you should implement desired ID to <form> elements.
formObject.reset() is JS method of FORM-object

onfocus not working in javascript

i am putting together some javascript form validation and i cant figure out how to get this onfocus to take hold of my div... i just need it to alert me that my onfocus function is making contact with my last name imput... :(
html:
<div id="contact">
<form name="form1" action="send.php" method="post" id="contact_f">
<table id="contact_table">
<tr>
<td class="col1" colspan="2">
<h1 class="center_text">Contact Aron</h1>
<div id="error_messages">
errors
</div>
</td>
</tr>
<tr>
<td class="col1">
<label for="first_name">First Name*</label><br>
<input id="first_name" required name="Name" type="text" pattern="[a-zA-Z]+">
</td>
<td class="col2">
<label for="last_name">Last Name*</label><br>
<input id="last_name" required type="text">
</td>
</tr>
<tr>
<td class="col1">
<label for="email">Email*</label><br>
<input id="email" required type="email">
</td>
<td class="col2">
<label for="confirm_email">Confirm Email*</label><br>
<input id="confirm_email" required type="text">
</td>
</tr>
<tr>
<td class="col1">
<label for="phone">Phone Number <span id="color_gray">xxx-xxx-xxxx</span></label><br>
<input id="phone" type="tel" pattern="\d{3}[\-]\d{3}[\-]\d{4}">
</td>
<td class="col2">
</td>
</tr>
<tr class="col2">
<td class="col1" colspan="2">
<label for="message">Message*</label><br>
<textarea id="message" required type="text"></textarea>
</td>
</tr>
<tr>
<td class="col1" colspan="2">
<button id="submit_button" type="submit" value="submit">Submit Form</button>
</td>
</tr>
</table>
</form>
javascript in question:
document.getElementById("last_name").onfocus=function() {
alert("last name");
};
Actually your code is working fine. You can try it with using jquery, like this -
$(document).ready(function() {
$( "#last_name" ).focus(function() {
alert("Last name");
});
});
You need to use:
document.getElementById("last_name").onfocus=function() {
alert(this.value);
};
Try this
window.addEventListener('load',function(){
document.getElementById("last_name").addEventListener('focus',function() {
alert(this.value);
});
});

Storing text box values in temporary table

I have a form that contain ten text boxes for entering some data. That form has a submit button and a next button. When I click on the next button, it has to open again ten text boxes, and has to store previous information into a temporary table in a MySQL database or in any other way. And finally, if I click on the submit button, it has to store that complete information into another permanent MySQL database table.
How can I do this?
This is what I tried so far:
<form name="form2" action="addingstuden_data.jsp" method="POST">
<table align="center">
<th colspan="3" class="style30"><font size="5">Adding Students for<%=stream%>-<%=year3%></th>
</table>
<table align="center" border="1">
<tr>
<td class="heading" align="center" >SNo</td>
<td class="heading" align="center" >Student Id</td>
<td class="heading" align="center">Student Name</td>
</tr>
<%
int i;
for(i=0;i<62;i++)
{
%>
<tr>
<td><input type="text" name="SNo" value="<%=i%>" id="r2" size="1"> </td>
<td><input type="text" name="stdid" id="sid" size="4" value=""> </td>
<td><input type="text" name="stdname" id="sname" value=""> </td>
</tr>
<% } %>
</table>
<table width="100%" class="pos_fixed">
<tr>
<td align="center" class="border"><input type="submit" name="submit" value="submit"> </td>
</tr>
</table>
</form>
Try this, Style it according to your need
<form name="myform" method="POST" action="youraction">
<div id="forms">
<input type="text" name="feilds[]">
<input type="text" name="feilds[]">
<input type="text" name="feilds[]">
<input type="text" name="feilds[]">
<input type="text" name="feilds[]">
<input type="text" name="feilds[]">
<input type="text" name="feilds[]">
<input type="text" name="feilds[]">
<input type="text" name="feilds[]">
<input type="text" name="feilds[]">
</div>
<input type="button" name="next" value="next" onclick="next()">
<input type="submit" name="submit" value="Submit">
</form>
Javascript code
function next()
{
var ele = document.getElementById('forms');
for(var i=0;i<10;i++)
{
var name = document.createElement("input");
name.setAttribute('type',"text");
name.setAttribute('name',"feilds[]");
ele.appendChild(name);
}
}
On server side loop through feilds[] array and get all the values

how to include a calender in a web page

hi i wanted to include a calender in my web page and after googling it i found this code
<!DOCTYPE html>
<html>
<head>
<link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>
<script>
$(document).ready(function() {
$("#datepicker").datepicker();
});
</script>
</head>
<body>
<table>
<tr>
<td>
DOB</td><td> <input id="datepicker" readonly/></td>
</tr>
</table>
</body>
</html>
now i wanted to add this in my web page.so within the head i wrote
<link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>
<script>
$(document).ready(function() {
$("#datepicker").datepicker();
});
</script>
and in input field i wrote
but calender is not opening when i click on the field.If you want my full code then it is as follows
<!DOCTYPE html> <!-- The new doctype -->
<html>
<head>
<link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>
<title>home</title>
<link rel="stylesheet" type="text/css" href="styles.css" />
</head>
<body> <script>
$(document).ready(function() {
$("#datepicker").datepicker();
});
</script>
<section id="page" > <!-- Defining the #page section with the section tag -->
<header > <!-- Defining the header section of the page with the appropriate tag -->
<hgroup>
<h1>Your Logo</h1>
<h3>and a fancy slogan</h3>
</hgroup>
<nav class="clear"> <!-- The nav link semantically marks your main site navigation -->
<ul>
<li>Personal Information</li>
<li>Medical History</li>
<li>Insurance Information</li>
</ul>
</nav>
</header>
<section id="articles"> <!-- A new section with the articles -->
<!-- Article 1 start -->
<div class="line"></div> <!-- Dividing line -->
<article id="article1"> <!-- The new article tag. The id is supplied so it can be scrolled into view. -->
<h2>Personal Information</h2>
<div class="line"></div>
<div class="articleBody clear">
<div >
<div style="float: left; padding-left: 50px; padding-top: 5px">
<table cellspacing="10" cellpadding="10" >
<tr>
<td width="200" height="30">
<b>Last Name</b>
</td>
<td>
<input type="text" name="lastname" value=""/>
</td>
</tr>
<tr>
<td height="30">
<b>First Name</b>
</td>
<td>
<input type="text" name="lastname" id="twoo" value=""/>
</td>
</tr>
<tr>
<td height="30">
<b>Date of Birth</b>
</td>
<td>
<input id="datepicker" readonly/>
</td>
</tr>
<tr>
<td height="30">
<b>Gender</b>
</td>
<td >
Male<input type="radio" name="lastname" value="male"/>
Female<input type="radio" name="lastname" value="male"/>
</td>
</tr>
<tr>
<td height="30">
<b>Occupation</b>
</td>
<td>
<input type="text" name="lastname" value=""/>
</td>
</tr>
<tr>
<td height="30">
<b>Race</b>
</td>
<td>
<input type="text" name="lastname" value=""/>
</td>
</tr>
<tr>
<td height="30">
<b>Mobile</b>
</td>
<td>
<input type="text" name="lastname" value=""/>
</td>
</tr>
<tr>
<td height="30">
<b>Phone</b>
</td>
<td>
<input type="text" name="lastname" value=""/>
</td>
</tr>
<tr>
<td height="30">
<b>Email</b>
</td>
<td>
<input type="text" name="lastname" value=""/>
</td>
</tr>
</table>
</div>
<div style="float: right;padding-right: 50px;padding-top: 50px">
<table>
<tr>
<td width="160" height="30">
<b>Address</b>
</td>
<td>
<input type="text" name="lastname" value=""/>
</td>
</tr>
<tr>
<td height="30">
<b>Street</b>
</td>
<td>
<input type="text" name="lastname" value=""/>
</td>
</tr>
<tr>
<td height="30">
<b>City</b>
</td>
<td>
<input type="text" name="lastname" value=""/>
</td>
</tr>
<tr>
<td height="30">
<b>State</b>
</td>
<td>
<input type="text" name="lastname" value=""/>
</td>
</tr>
<tr>
<td height="30">
<b>Country</b>
</td>
<td>
<input type="text" name="lastname" value=""/>
</td>
</tr>
<tr>
<td height="30">
<b>Pin Code</b>
</td>
<td>
<input type="text" name="lastname" value=""/>
</td>
</tr>
<tr>
<td height="30">
<b>Height</b>
</td>
<td>
<input type="textbox" name="lastname" value=""/>
</td>
</tr>
<tr>
<td height="30">
<b>Weight</b>
</td>
<td>
<input type="textbox" name="lastname" value="" height="10" width="10"/>
</td>
</tr>
<td height="30">
<b>BP</b>
</td>
<td>
<input type="textbox" name="lastname" value="" height="10" width="10"/>
</td>
</tr>
<td height="30">
<b>Blood Group</b>
</td>
<td>
<input type="textbox" name="lastname" value="" height="10" width="10"/>
</td>
</tr>
</table><div align="center" style="padding-top: 30px">
</div>
</div>
</div>
</div>
</article>
<!-- Article 1 end -->
<!-- Article 2 start -->
<div class="line"></div>
<div class="space"></div> <div class="space"></div> <div class="space"></div> <div class="space"></div>
<div class="space"></div><div class="space"></div><div class="space"></div><div class="space"></div><div class="space"></div><div class="space"></div><div class="space"></div>
<div class="space"></div><div class="space"></div><div class="space"></div><div class="space"></div><div class="space"></div><div class="space"></div>
<article id="article2">
<h2>Medical History</h2>
<div class="line"></div>
<div class="articleBody clear"><!--
<figure>
<img src="medical.jpg" width="620" height="440" /></a>
</figure>
<p><div align="center" style="padding-top: 30px">
<table cellspacing="10" cellpadding="10">
<tr>
<td width="200" height="30"><h5>Old Password</h5></td>
<td height="30"><input name="old" type="password"></td>
</tr>
<tr>
<td height="30"><h5>New Password</h5></td>
<td height="30"><input name="newPsw" type="password"></td>
</tr>
<tr>
<td height="30"><h5>Confirm Password</h5></td>
<td height="30"><input name="confirm" type="password"></td>
</tr>
</table>
</div> -->
<div style="float: left; padding-left: 50px; padding-top: 5px">
<table cellspacing="10" cellpadding="10" >
<tr>
<td width="200" height="30">
<b>Diabetes</b>
</td>
<td>
<input type="radio" name="lastname" value=""/>
</td>
</tr>
<tr>
<td height="30">
<b>Insulin</b>
</td>
<td>
<input type="radio" name="lastname" value=""/>
</td>
</tr>
<tr>
<td height="30">
<b>Obesity</b>
</td>
<td>
<input type="radio" name="lastname" value=""/>
</td>
</tr>
<tr>
<td height="30">
<b>Hypertension</b>
</td>
<td >
<input type="text" name="lastname" value=""/>
</td>
</tr>
<tr>
<td height="30">
<b>Pancreatis</b>
</td>
<td>
<input type="text" name="lastname" value=""/>
</td>
</tr>
<tr>
<td height="30">
<b>Renal Problems</b>
</td>
<td>
<input type="text" name="lastname" value=""/>
</td>
</tr>
<tr>
<td height="30">
<b>Neuropathy</b>
</td>
<td>
<input type="text" name="lastname" value=""/>
</td>
</tr>
<tr>
<td height="30">
<b>Amputations</b>
</td>
<td>
<input type="text" name="lastname" value=""/>
</td>
</tr>
<tr>
<td height="30">
<b>GERD</b>
</td>
<td>
<input type="text" name="lastname" value=""/>
</td>
</tr>
<tr>
<td height="30">
<b>Cardiac Problem</b>
</td>
<td>
<input type="text" name="lastname" value=""/>
</td>
</tr>
<tr>
<td height="30">
<b>Retinal Problem</b>
</td>
<td>
<input type="text" name="lastname" value=""/>
</td>
</tr>
</table>
</div>
<div style="float: right;padding-right: 50px;padding-top: 50px">
<table>
<tr>
<td width="160" height="30">
<b>Sleep Arnoea</b>
</td>
<td>
<input type="text" name="lastname" value=""/>
</td>
</tr>
<tr>
<td height="30">
<b>Erectile Dysfunction</b>
</td>
<td>
<input type="text" name="lastname" value=""/>
</td>
</tr>
<tr>
<td height="30">
<b>Thyroid Problem</b>
</td>
<td>
<input type="text" name="lastname" value=""/>
</td>
</tr>
<tr>
<td height="30">
<b>Liver Problem</b>
</td>
<td>
<input type="text" name="lastname" value=""/>
</td>
</tr>
<tr>
<td height="30">
<b>Constipation</b>
</td>
<td>
<input type="text" name="lastname" value=""/>
</td>
</tr>
<tr>
<td height="30">
<b>Asthma</b>
</td>
<td>
<input type="text" name="lastname" value=""/>
</td>
</tr>
<tr>
<td height="30">
<b>TB</b>
</td>
<td>
<input type="textbox" name="lastname" value=""/>
</td>
</tr>
<tr>
<td height="30">
<b>Diet Control</b>
</td>
<td>
<input type="radio" name="lastname" value="" height="10" width="10"/>
</td>
</tr>
<td height="30">
<b>Craving for Sweets</b>
</td>
<td>
<input type="radio" name="lastname" value="" height="10" width="10"/>
</td>
</tr>
<td height="30">
<b>Smoking</b>
</td>
<td>
<input type="radio" name="lastname" value="" height="10" width="10"/>
</td>
</tr>
</table>
<div class="footer-bar" align="center" style="padding-top: 30px">
<table align="center" >
<tr >
<td width="100" align="center"><input type="submit" class="button button-submit" value="Submit" /></td>
<td width="100" align="center"><input type="reset" class="button button-submit" value="Reset" /></td>
</tr>
</table>
</div></p>
<p></p>
</div>
</article>
<!-- Article 2 end -->
<!-- Article 3 start -->
<div class="line"></div>
<article id="article3">
<h2>Insurance Information</h2>
<div class="line"></div>
<div class="articleBody clear"><!-- -->
<div style="float: left; padding-left: 50px; padding-top: 5px">
<table cellspacing="10" cellpadding="10" >
<tr>
<td height="30">
<b>Insurance Company Name</b>
</td>
<td>
<input type="text" name="lastname" value=""/>
</td>
</tr>
<tr>
<td height="30">
<b>Policy Name</b>
</td>
<td>
<input type="text" name="lastname" value=""/>
</td>
</tr>
<tr>
<td height="30">
<b>Policy No</b>
</td>
<td>
<input type="text" name="lastname" value=""/>
</td>
</tr>
<tr>
<td height="30">
<b>Validity</b>
</td>
<td>
<input type="text" name="lastname" value=""/>
</td>
</tr>
</table>
</div>
<div style="float: right;padding-right: 50px;padding-top: 50px">
<table>
<tr>
<td height="30">
<b>Constipation</b>
</td>
<td>
<input type="text" name="lastname" value=""/>
</td>
</tr>
<tr>
<td height="30">
<b>Asthma</b>
</td>
<td>
<input type="text" name="lastname" value=""/>
</td>
</tr>
<tr>
<td height="30">
<b>TB</b>
</td>
<td>
<input type="textbox" name="lastname" value=""/>
</td>
</tr>
</tr>
</table>
<div class="footer-bar" align="center" style="padding-top: 30px">
<table align="center" >
<tr >
<td width="100" align="center"><input type="submit" class="button button-submit" value="Submit" /></td>
<td width="100" align="center"><input type="reset" class="button button-submit" value="Reset" /></td>
</tr>
</table>
</div></p>
<p></p>
</div>
</article>
<!-- Article 3 end -->
</section>
<footer> <!-- Marking the footer section -->
<div class="line"></div>
<p>Copyright 2013 - mysite.com</p>
Go UP
spanwave
</footer>
</section> <!-- Closing the #page section -->
<!-- JavaScript Includes -->
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
<script src="jquery.scrollTo-1.4.2/jquery.scrollTo-min.js"></script>
<script src="script.js"></script>
</body>
</html>
i have been trying to sort out the error since last one hour but could not fix it.
it is because your input field is readonly
<input id="datepicker" readonly/>
//----^^^^---here
so the click on input won't fire thus.. not firing the datepicker , removing that(readonly) should work
Just remove the last two scripts you have included in bottom .You have already included jquery script at top.It will work fine
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
<script src="script.js"></script>

Categories