adding date picker and combo to inline edit fields
Hi,
I am new at this. So far i have figured out how to incorporate an inline edit feature to my application.
What I need now is when you click on the field to edit it will have a datepicker or combo.
Also a way that it knows its a date field or a combo field.
Here is the code I have for the inline edit
- <script type="text/javascript">
- $(document).ready(function(){
- $('td.edit').click(function(){
- $('.ajax').html($('.ajax input').val());
- $('.ajax').removeClass('ajax');
- $(this).addClass('ajax');
- $(this).html('<input id="editbox" size="'+$(this).text().length+'" type="text" value="' + $(this).text() + '">');
- $('#editbox').focus();
- }
- );
- $('td.edit').keydown(function(event){
- arr = $(this).attr('class').split( " " );
- if(event.which == 13){
- $.ajax({
- type: "POST",
- url:"config.php",
- data: "value="+$('.ajax input').val()+"&rownum="+arr[2]+"&field="+arr[1],
- success: function(data){
- $('.ajax').html($('.ajax input').val());
- $('.ajax').removeClass('ajax');
- }});
- }
- }
- );
- $('#editbox').live('blur',function(){
- $('.ajax').html($('.ajax input').val());
- $('.ajax').removeClass('ajax');
- });
- });
- </script>
Any help would be appreciated very much.
Chuck