• onclick syntax

    Author
    Topic
    #390848

    The members of this group have helped me figure out how to control the launching of Word templates using vbscript and the Onclick event. I have another newbie question,

    I can’t seem to figure out what should be a simple syntax. I must be having a brain seizure or something.

    What I want to do is display a label on the page, such as “Fax Transmital”

    And when that is clicked on, run an onClick Event, such as:

    onClick=’MakeNew($path)’

    Could someone be kind with a clue?

    Thanks
    Jim Helfer

    Viewing 0 reply threads
    Author
    Replies
    • #695809

      If you want, you can use standard hyperlink syntax and substitute “java script:MakeNew(‘$path’)” for the URL.

      If you don’t want the hyperlink look, you can surround the label with and tags and put the onClick= statement in the tag.

      There may be other ways, for example, if the label is a graphic or in its own

      .

      • #696174

        Thanks, I’ve been playing with the syntax of both span and a, and I can’t seem to get anything to work correctly other than exactly what was typed for me in the example code.

        Frontpage, and “AccentHTML” only seems to recognize one error message: “Expected ]” that occurs at a nonsensical line and column number.

        Jim

        • #696199

          Maybe if I candemonstrate what I’ve tried:

          Label1

          Label2

          Label3

          To create a new document based on test.dot,
          Label4

          When I click:

          Label1: “Expected ‘]’
          Label2: Unterminated String Constant
          Label3: Syntax Error
          Label4: fires script as expected (this is the copied code)

          These error messages all seem to be non-sequitors, and don’t help me at all when trying to figure out what the “secret syntax” might be.

          Like I said before, I’m a newbie at this. What happened was, one of my users spent a lot of time in FrontPage making a bunch of usefull pages for an Office Intranet. Once he was done, he came to me to customize all the links to get them to do exactly what he wanted. So, I’m trying to figure out all the programming and all the tags, and all the Frontapage all at once (the user has never seen any HTML at all. Just FP).
          This particular link needs to get nestled in some cell-like structure, so I’m not sure if I can use the SPAN keword. But I guess I am going to try now.

          I’d apreciate if anyone could clue me in on where I’m going wrong on the above. I don’t think the change requests are going to stop anytime soon, so I’d like to get a handle on these basics.

          Thanks
          Jim H

          • #696326

            Label1

            There are WAY too many quotation marks in this link. JavaScript does not have a problem with spaces in paths, only Windows has a problem with this, so you’ll need to deal with adding the quotation marks inside your script, not in the link. Try this:

            Label1

            (Note: I forgot the ; before. Not sure IE is strict about this, but it seems best to add it to the end of any JavaScript statement for good measure.)

    Viewing 0 reply threads
    Reply To: onclick syntax

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: