Graphical selection

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Bob Bedford

    Graphical selection

    I've to create a theater seat plan, where people may book online their
    seats. It' there any way to "draw" seats with javascript (of different
    colors, as closer your are to the scene, more you pay) and then select the
    seats (so they change color when selected) and on the same page, change the
    total price when changes are done ???? This should be on a FORM that I will
    use to save the selected seats in a database.

    Any idea ???? any close script I may use ????

    Thanks for help

    BoB



  • Martin Honnen

    #2
    Re: Graphical selection



    Bob Bedford wrote:
    [color=blue]
    > I've to create a theater seat plan, where people may book online their
    > seats. It' there any way to "draw" seats with javascript (of different
    > colors, as closer your are to the scene, more you pay) and then select the
    > seats (so they change color when selected) and on the same page, change the
    > total price when changes are done ???? This should be on a FORM that I will
    > use to save the selected seats in a database.[/color]

    Drawing seats can be done by SVG which can be manipulated by JavaScript,
    Adobe has a demo of that at


    --

    Martin Honnen


    Comment

    • Grant Wagner

      #3
      Re: Graphical selection


      Bob Bedford wrote:
      [color=blue]
      > I've to create a theater seat plan, where people may book online their
      > seats. It' there any way to "draw" seats with javascript (of different
      > colors, as closer your are to the scene, more you pay) and then select the
      > seats (so they change color when selected) and on the same page, change the
      > total price when changes are done ???? This should be on a FORM that I will
      > use to save the selected seats in a database.
      >
      > Any idea ???? any close script I may use ????
      >
      > Thanks for help
      >
      > BoB[/color]

      My first thought would be to produce two images with a floorplan of the
      theatre, using different colors for selected and unselected, then chop it up
      into thousands(?) of images, one for each seat. Use a table to reassemble the
      image, then add Javascript to detect the clicks, swap images and keep track of
      everything. Using an image map might seem like a viable solution, but support
      for mouse events on image maps is worse then Javascript support in general, and
      you'd have the problem of not being able to change the color of selected seats.

      Using a thousand (?) image solution would result in a _huge_ amount of HTML
      being delivered to the client's browser and would be dependant on the user
      having Javascript enabled. So you'd be telling dialup users or those who have
      choosen to disable Javascript that you aren't interested in their business.

      Whatever solution you finally arrive at, I'd think you should consider people
      with slower connections and those without Javascript available/enabled.

      And no, it's highly unlikely there is any sort of pre-written script to do what
      you want, although examples the individual bits you need to make it all work
      (handling image swaps, managing form data, etc) are available (with various
      levels of Javascript authoring competence) all over the Internet.

      --
      | Grant Wagner <gwagner@agrico reunited.com>

      * Client-side Javascript and Netscape 4 DOM Reference available at:
      *


      * Internet Explorer DOM Reference available at:
      *
      Find official documentation, practical know-how, and expert guidance for builders working and troubleshooting in Microsoft products.


      * Netscape 6/7 DOM Reference available at:
      * http://www.mozilla.org/docs/dom/domref/
      * Tips for upgrading JavaScript for Netscape 7 / Mozilla
      * http://www.mozilla.org/docs/web-deve...upgrade_2.html

      Comment

      • Bob Bedford

        #4
        Re: Graphical selection

        Thanks Martin,

        I need something without installing any plugin !!!! but this can be done in
        pure Javascript and also in server side script (PHP/ASP), without the need
        for a plugin.

        I am wrong saying this ??? OnMouseOver and OnMouseClick can be used to
        switch the image type of a certain place ??? I've never worked with it, so I
        don't know if it works.

        Please tell me if it can be done with Javascript and PHP !

        BoB

        "Martin Honnen" <mahotrash@yaho o.de> a écrit dans le message de
        news:40e2db40$1 @olaf.komtel.ne t...[color=blue]
        >
        >
        > Bob Bedford wrote:
        >[color=green]
        > > I've to create a theater seat plan, where people may book online their
        > > seats. It' there any way to "draw" seats with javascript (of different
        > > colors, as closer your are to the scene, more you pay) and then select[/color][/color]
        the[color=blue][color=green]
        > > seats (so they change color when selected) and on the same page, change[/color][/color]
        the[color=blue][color=green]
        > > total price when changes are done ???? This should be on a FORM that I[/color][/color]
        will[color=blue][color=green]
        > > use to save the selected seats in a database.[/color]
        >
        > Drawing seats can be done by SVG which can be manipulated by JavaScript,
        > Adobe has a demo of that at
        > http://www.adobe.com/svg/demos/devtrack/theater.html
        >
        > --
        >
        > Martin Honnen
        > http://JavaScript.FAQTs.com/
        >
        >[/color]



        Comment

        • Randy Webb

          #5
          Re: Graphical selection

          Grant Wagner wrote:[color=blue]
          > Bob Bedford wrote:
          >
          >[color=green]
          >>I've to create a theater seat plan, where people may book online their
          >>seats. It' there any way to "draw" seats with javascript (of different
          >>colors, as closer your are to the scene, more you pay) and then select the
          >>seats (so they change color when selected) and on the same page, change the
          >>total price when changes are done ???? This should be on a FORM that I will
          >>use to save the selected seats in a database.
          >>
          >>Any idea ???? any close script I may use ????
          >>
          >>Thanks for help
          >>
          >>BoB[/color]
          >
          >
          > My first thought would be to produce two images with a floorplan of the
          > theatre, using different colors for selected and unselected, then chop it up
          > into thousands(?) of images, one for each seat. Use a table to reassemble the
          > image, then add Javascript to detect the clicks, swap images and keep track of
          > everything. Using an image map might seem like a viable solution, but support
          > for mouse events on image maps is worse then Javascript support in general, and
          > you'd have the problem of not being able to change the color of selected seats.[/color]

          Each "seat image" would be a transparent gif that you could, onclick,
          change its background color. Then, you only need one image. Perhaps 4
          images if the stage is centered with chairs/seats on all 4 sides.

          --
          Randy
          Chance Favors The Prepared Mind
          comp.lang.javas cript FAQ - http://jibbering.com/faq/

          Comment

          • Jim Ley

            #6
            Re: Graphical selection

            On Wed, 30 Jun 2004 18:50:45 +0200, "Bob Bedford"
            <bedford1@YouKn owWhatToDoHereh otmail.com> wrote:
            [color=blue]
            >I need something without installing any plugin !!!! but this can be done in
            >pure Javascript and also in server side script (PHP/ASP), without the need
            >for a plugin.[/color]

            Since you're relying on javascript for the enhanced functionality, you
            might aswell rely on a plugin too, and just leave the other folk with
            the simple view (a static image and a form saying "which seats")
            [color=blue]
            >I am wrong saying this ??? OnMouseOver and OnMouseClick can be used to
            >switch the image type of a certain place ??? I've never worked with it, so I
            >don't know if it works.[/color]

            Not in a remotely efficient way.

            Jim.
            --
            comp.lang.javas cript FAQ - http://jibbering.com/faq/

            Comment

            Working...