Click here to Skip to main content
15,896,111 members
Please Sign up or sign in to vote.
1.00/5 (4 votes)
See more:
Hi ,
this is srikanthi am working as a dotnet developer on a project called unibus a bus portal in that project i have stucked at one place that if i select seat that particular seat no should display in the same page instead of getting in another window i have developed that app in javascript and jquery can u help me by seeing that code and can solve my problem by providing suitable code..thanks in advance..

the reference link is dsiplayed below:

http://techbrij.com/seat-reservation-with-jquery
plz open this link and see the code once same code i have copied from this site here thecode is by clicking on show buton the particular seat no is displaying but i dont want that action by clicking on seat that seat no should display in same page in the below seat label...waiting for your reply..
Posted
Updated 20-Sep-13 0:33am
v2

1 solution

You can add two placeholder's like

with some ID -

HTML
<p id="booked-seats"></p>
<p id="selected-seats"></p>


And, modify the code as below -
JavaScript
$('#btnShow').click(function () {
    var str = [];
    $.each($('#place li.' + settings.selectedSeatCss + ' a, #place li.'+ settings.selectingSeatCss + ' a'), function (index, value) {
        str.push($(this).attr('title'));
    });

    //use .text() to add text to html elements where alert has been used
    $('#booked-seats').text("Booked Seats : " + str.join(','));
});


$('#btnShowNew').click(function () {
    var str = [], item;
    $.each($('#place li.' + settings.selectingSeatCss + ' a'), function (index, value) {
        item = $(this).attr('title');
        str.push(item);
    });
   
   
    //use .text() to add text to html elements where alert has been used
   $('#selected-seats').text("Selected Seats : " + str.join(','));
});


I hope this helps.
Thanks

 
Share this answer
 
v2
Comments
Member 10062282 21-Sep-13 1:48am    
hi ashu,
u have send the code jsut to remov button functionality but what i need is if i select any seat that particular seat no should display in seat labe and seat selection should not be more than 6 seats and even we need to include ladies seats such if we mouseover on ladies seat it should show ladies should book the ticket

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900