Loading ...
Sorry, an error occurred while loading the content.
 

Problem with SVG and Javascript

Expand Messages
  • derguteonkeldod
    Hello, I want to manipulate the value of a HTML form by Javascript. I got this error message: document.SVGdata.elements is Null or no object . I really don t
    Message 1 of 4 , Jun 29, 2005
      Hello,

      I want to manipulate the value of a HTML form by Javascript.
      I got this error message: 'document.SVGdata.elements is Null or no
      object'. I really don't know why.
      BTW: the HTML code is embedded in a portlet (Jetspeed2 Portal). Maybe
      this could help finding a solution.


      That's the Javascript function:

      function onclickFunction(evt)
      {
      seat = evt.getTarget();
      document.SVGdata.elements['SeatNr'].value=seat.getAttribute("id");document.SVGdata.submit();
      }
      (I also tried 'document.SVGdata.SeatNr.value',
      'document.forms['SVGdata'}.elements['SeatNr'].value')

      ...and that's the HTML code:

      <form name="SVGdata" id="SVGdata" method="POST"
      action="http://localhost:8080/">
      <input type="hidden" name="SeatNr" value="">
      </form>
      <embed src="http://localhost:8080/HelloWorld/Test.svg"
      type="image/svg-xml" width="100px" height="100px"/>
    • Nicholas Lucaroni
      looks decent... try removing document. ? ... Maybe ... ( id );document.SVGdata.submit();
      Message 2 of 4 , Jun 29, 2005
        looks decent... try removing 'document.' ?

        --- In svg-developers@yahoogroups.com, "derguteonkeldod"
        <derguteonkeldod@y...> wrote:
        > Hello,
        >
        > I want to manipulate the value of a HTML form by Javascript.
        > I got this error message: 'document.SVGdata.elements is Null or no
        > object'. I really don't know why.
        > BTW: the HTML code is embedded in a portlet (Jetspeed2 Portal).
        Maybe
        > this could help finding a solution.
        >
        >
        > That's the Javascript function:
        >
        > function onclickFunction(evt)
        > {
        > seat = evt.getTarget();
        > document.SVGdata.elements['SeatNr'].value=seat.getAttribute
        ("id");document.SVGdata.submit();
        > }
        > (I also tried 'document.SVGdata.SeatNr.value',
        > 'document.forms['SVGdata'}.elements['SeatNr'].value')
        >
        > ...and that's the HTML code:
        >
        > <form name="SVGdata" id="SVGdata" method="POST"
        > action="http://localhost:8080/">
        > <input type="hidden" name="SeatNr" value="">
        > </form>
        > <embed src="http://localhost:8080/HelloWorld/Test.svg"
        > type="image/svg-xml" width="100px" height="100px"/>
      • derguteonkeldod
        Thank you so much! That s it!
        Message 3 of 4 , Jun 30, 2005
          Thank you so much!
          That's it!
        • Jonathan Watt
          I would recommend that instead of removing document. you make it document.getElementById( SVGdata ).elements... This should work in a wider range of
          Message 4 of 4 , Jul 1, 2005
            I would recommend that instead of removing 'document.' you make it
            document.getElementById('SVGdata').elements...

            This should work in a wider range of browsers, and is likely to
            continue working in future.


            On 6/30/05, Nicholas Lucaroni <U.mojan@...> wrote:
            > looks decent... try removing 'document.' ?
            >
            > --- In svg-developers@yahoogroups.com, "derguteonkeldod"
            > <derguteonkeldod@y...> wrote:
            > > Hello,
            > >
            > > I want to manipulate the value of a HTML form by Javascript.
            > > I got this error message: 'document.SVGdata.elements is Null or no
            > > object'. I really don't know why.
            > > BTW: the HTML code is embedded in a portlet (Jetspeed2 Portal).
            > Maybe
            > > this could help finding a solution.
            > >
            > >
            > > That's the Javascript function:
            > >
            > > function onclickFunction(evt)
            > > {
            > > seat = evt.getTarget();
            > > document.SVGdata.elements['SeatNr'].value=seat.getAttribute
            > ("id");document.SVGdata.submit();
            > > }
            > > (I also tried 'document.SVGdata.SeatNr.value',
            > > 'document.forms['SVGdata'}.elements['SeatNr'].value')
            > >
            > > ...and that's the HTML code:
            > >
            > > <form name="SVGdata" id="SVGdata" method="POST"
            > > action="http://localhost:8080/">
            > > <input type="hidden" name="SeatNr" value="">
            > > </form>
            > > <embed src="http://localhost:8080/HelloWorld/Test.svg"
            > > type="image/svg-xml" width="100px" height="100px"/>
            >
            >
            >
            >
            > -----
            > To unsubscribe send a message to: svg-developers-unsubscribe@yahoogroups.com
            > -or-
            > visit http://groups.yahoo.com/group/svg-developers and click "edit my membership"
            > ----
            > Yahoo! Groups Links
            >
            >
            >
            >
            >
            >
            >
          Your message has been successfully submitted and would be delivered to recipients shortly.