Assigning functions to buttons

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

    Assigning functions to buttons


    Hi,

    I am creating a tool to merge xml files using xslt usin
    Javascript/HTML.

    Basically the user browses (browse button) to where there xml file
    are, then browses to where their xslt file (to perform an operation
    is. Then they click an "apply" button and the result is output in
    frame below.

    My problem:

    I have the tool working fine when I only have one input xml file (whic
    is no good in a merge tool!!) but when I modify the code and ad
    another xml field, the apply button will not work for two fields!

    I think I haven't assigned the functions correctly to the xm
    fields/apply button. Heres some of the code I suspect is wrong, but i
    not sure where??

    <table width="800">
    <tr>
    <td width="370">
    XML File 1
    <input type="file" size=15 id="xmlField1" >
    <input type="button" value="XML Src
    onClick="ApplyS tyleSheet(xmlFi eld1.value, 'defaultss.xml' );" id=xmlsr
    name=xmlsrc>
    XML File 2
    <input type="file" size=15 id="xmlField2" >
    <input type="button" value="XML Src
    onClick="ApplyS tyleSheet(xmlFi eld2.value, 'defaultss.xml' );" id=xmlsr
    name=xmlsrc>
    </td><td> </td>
    <td width="370">
    XSL File
    <input type="file" size=15 id="xslField">

    <input type="button" value="XSL Src
    onClick="ApplyS tyleSheet(xslFi eld.value, 'defaultss.xml' );" id=xslsr
    name=xslsrc>
    </td></tr>
    <tr><td> </td>
    <td width="80">
    <input type="button" value="Apply
    onClick="ApplyS tyleSheet(xmlFi eld1.value && xmlField2.value
    xslField.value) ;">
    </td><td> </td>
    </tr>
    </table>

    Any suggestions/advice/feedback would be greatly appreciated.

    Many Thanks
    Ciara

    cmckenna8
    -----------------------------------------------------------------------
    Posted via http://www.forum4designers.co
    -----------------------------------------------------------------------
    View this thread: http://www.forum4designers.com/message45839.htm

  • Richard Cornford

    #2
    Re: Assigning functions to buttons

    "cmckenna82 " <cmckenna82.11p 3st@mail.forum4 designers.com> wrote in
    message news:cmckenna82 .11p3st@mail.fo rum4designers.c om...
    <snip>[color=blue]
    > Posted via http://www.forum4designers.com[/color]

    forum4designers .com is a bad place to read comp.lang.javas cript from
    because their presentation of the group garbles the Usenet posts it is
    derived from. Removing *significant* formatting, omitting sections and
    adding text and white space that was not part of the original posts to
    Usenet. And they only report a fraction of the posts made to the
    group, giving an incomplete and inaccurate representation of the group.

    In addition, the posting mechanism used by forum4designers .com fails
    to properly implement RFC 1036 (Standard for Interchange of USENET
    Messages), and in a way that is likely to result in confusion as to
    conversational flow and intended respondee for anyone using genuine
    Usenet software.

    forum4designers .com is also a bad pace to ask javascript questions
    from because their misrepresentati on of the group, combined with
    deliberate deceptions about the nature of the service that they
    provide, have resulted in a level of resentment of
    forum4designers .com that will negatively impact on anyone who decides
    to associate themselves with that web site.

    But being aware that forum4designers .com may not report posts made in
    response to questions asked from there, and will actively
    modify/distort any responses they do show, potential responders may
    consider it a waste of there time to put any effort into responding to
    posts originating from forum4designers .com even if they have no
    attitude towards that site.

    Many other sites provide superior web-based access to Usenet, and
    often without distortion or omission, including groups.google.c om
    (who also provide extensive and flexible archive searching
    facilities). But the best method of reading and posting to
    comp.lang.javas cript is through a news server via (standard and
    standards conforming) newsreader software.

    Richard.


    Comment

    • Dr John Stockton

      #3
      Re: Assigning functions to buttons

      JRS: In article <c11674$4s8$1$8 302bc10@news.de mon.co.uk>, seen in
      news:comp.lang. javascript, Richard Cornford
      <Richard@litote s.demon.co.uk> posted at Thu, 19 Feb 2004 02:14:59 :-
      [color=blue]
      >Many other sites provide superior web-based access to Usenet, and
      >often without distortion or omission, including groups.google.c om
      >(who also provide extensive and flexible archive searching
      >facilities).[/color]

      "and often"? After "Many", ISTM not needed.

      Anyone who can use the offending site can use "Google Groups"
      <http://groups.google.c om/> to observe the full content of this
      newsgroup and compare it with the censored version.

      [color=blue]
      > But the best method of reading and posting to
      >comp.lang.java script is through a news server via (standard and[/color]
      ^^^^^^^^^^^^
      I'd omit those words; the only likely interpretations , to the type of
      user being addressed, are "Web" and/or "MSOE". There is no need for
      standard software when one can have standards-conforming software.
      [color=blue]
      >standards conforming) newsreader software.[/color]

      --
      © John Stockton, Surrey, UK. ?@merlyn.demon. co.uk Turnpike v4.00 MIME ©
      Web <URL:http://www.uwasa.fi/~ts/http/tsfaq.html> -> Timo Salmi: Usenet Q&A.
      Web <URL:http://www.merlyn.demo n.co.uk/news-use.htm> : about usage of News.
      No Encoding. Quotes before replies. Snip well. Write clearly. Don't Mail News.

      Comment

      • Richard Cornford

        #4
        Re: Assigning functions to buttons

        "Dr John Stockton" <spam@merlyn.de mon.co.uk> wrote in message
        news:9meT19HlyO NAFw3c@merlyn.d emon.co.uk...
        <snip>[color=blue][color=green]
        >>... , and often without distortion or omission, ...[/color][/color]
        <snip>[color=blue]
        >"and often"? After "Many", ISTM not needed.[/color]

        I am not so sure. The software that forum4designers uses is open source
        and currently in use by other sites, some of whom are using similar HTML
        presentation. So they too will be trimming and generally garbling their
        content, and if subject to a similar campaign of criticism may also
        resort to direct censorship.

        Fortunately these other sites do not seem to be attracting any users so
        they are currently no a problem (some of the ones I looked at are so
        obviously run by charlatans that even the very dim would not choose to
        use them). But there is no advantage to the users of forum4designers if
        they switch to an alternative provider of web-based access if that
        provider is just as bad as (or potentially worse than) forum4designers .

        Given the availability of the software and the number of sites using it
        I don't know why forum4designers appears to be the only one attracting
        users, and thus attention. They have probably invested in some sort of
        direct promotion, which would explain their reluctance to come clean
        about the true nature and quality of their service (as that may directly
        contradict their promotional material).

        Incidentally, forum4designers seems to be conceding the formatting
        point. They are now replacing the space characters in posts with &nbsp;
        in the HTML. So some of the code indenting will be preserved. It is not
        a good solution because their HTML is erroneous and bloated to start
        with so adding 5 bytes for every space in the source is passing quite a
        burden on to their users (especially in comparison to the obvious
        alternative).
        [color=blue]
        >Anyone who can use the offending site can use "Google Groups"
        ><http://groups.google.c om/> to observe the full content of
        >this newsgroup and compare it with the censored version.[/color]
        <snip>

        And to post from there, avoiding the unfortunate associations and
        substandard posting software.

        Richard.


        Comment

        Working...