Announcement

Collapse
No announcement yet.

Assigning actinic variable in java script or HTML

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Assigning actinic variable in java script or HTML

    If I create a custom variable is there anyway to assign a value to that variable within javascript or the html code of the page? Thanks

    #2
    not quite sure what you're trying to do...

    but...

    You can get the values from Custom Variables into javascript variables to be exectued in the users browser, but not the other way round because javascript is a client side technology and therefore can't talk back to Actinic, javascript can talk back to the server in some situations like AJAX but Actinic isn't a server based technology it instead generates static HTML - and I'm not sure why you'd want to do this anyway as the custom variable is simply entended as a way for the store owner to enter data using the Program GUI

    You can get the values from Custom Variables into PHP to be executed on the desktop but again not back the other way... Think this is probably closer to what you are trying to acheive...

    Or if you set your server up to execute .html pages through the php engine you could possibly get it do some things on the server too... really it would be handy to know what you are trying to do...
    Wayne Theisinger

    The Web's just settling in. We got the tech, now let's put up something that matters.

    Comment


      #3
      Sorry, no. They're read-only.

      What you could do is assign a value to a PHP variable from that custom variable. That PHP value would now be accessible to layouts in other pages that are processed later.

      E.g.

      In one layout
      Code:
      <actinic:block php="true">
      $myvar = <actinic:variable name="MyVariable" encoding="perl" selectable="false" />;  // MyVariable contains a number e.g. 100
      </actinic:block>
      and in another layout have
      Code:
      <actinic:block php="true">
      $myvar += 1; // Increment it.
      echo $myvar;
      </actinic:block>
      We'd now see 101 displayed.
      Norman - www.drillpine.biz
      Edinburgh, U K / Bitez, Turkey

      Comment

      Working...
      X