Javascript search number and display

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • 848lu
    New Member
    • Dec 2006
    • 37

    #1

    Javascript search number and display

    hi, im making a website which allows users to search with number and display it on another page with an option button...

    it is a online hotel booking system. so they search number of rooms they need and this result is displayed in another page...

    i was thinking i might have to use Array or something like that..

    please can someone start me off??


    much appreciated
  • 848lu
    New Member
    • Dec 2006
    • 37

    #2
    ok this is what i have at the moment...

    <script type="text/javascript">
    var myrooms= new Array()
    myrooms[0] = "1"
    myrooms[1] = "2"
    myrooms[2] = "3"

    for (i=0;i<mycars.l ength;i++)
    {
    document.write( myrooms[i] + "<br />")
    }
    </script>
    ^^ and this will display all the 1, 2, 3 on the document. but i wanted to add option button to add, and search from the previous page

    Comment

    • acoder
      Recognized Expert MVP
      • Nov 2006
      • 16032

      #3
      For an online booking system, you really should be doing it using server-side code. The data should be stored in the database, e.g. rooms, rooms available, etc.

      Javascript can be used to help in validation and some client-side functionality.

      Comment

      • 848lu
        New Member
        • Dec 2006
        • 37

        #4
        Originally posted by acoder
        For an online booking system, you really should be doing it using server-side code. The data should be stored in the database, e.g. rooms, rooms available, etc.

        Javascript can be used to help in validation and some client-side functionality.
        thats the thing, we are asked to make front-end system, not a backend as in no database

        Comment

        • acoder
          Recognized Expert MVP
          • Nov 2006
          • 16032

          #5
          Originally posted by 848lu
          thats the thing, we are asked to make front-end system, not a backend as in no database
          So how would you know how many rooms are available?

          How would you update the system to show that there are currently no rooms available?

          Just a front-end is fine for just information, but if it's a booking system, you need a back-end.

          Comment

          Working...