how to keep quotes from changing to " in Javascripts

jbyrley

Member
How can I get the element custom javascript box to save quotes as quotes rather than " ?

Here are my settings I think are relevant to this issue:

php.ini -- magic_quotes_runtime=Off
J! text filters -- Super User no filtering
Fabrik element access -- form(edit) Super Users
(I'm logged in as Super User)
 
We have to do that, for a variety of reasons.

However, we do this when the event is dispatched, in form.js, as the first lines in dispatchEvent(), like 894 ...

Code:
            if (typeOf(js) === 'string') {
                js = Encoder.htmlDecode(js);
            }

... so it should be decoded by the time your code runs.

-- hugh
 
Okay, thanks. I managed to get windows.alert("hello world") to work on a radiobutton change event. I haven't yet figured out how to get an element to show/hide on a change event via custom Javascript (I know I can do it using the predefined actions, but it is a bit too cumbersome for the number of events I need to handle.

So far I'm basically going to the html source, then copying the js code for these predefined actions, and pasting them into the custom js area to see if I can replicate the effect. This hasn't worked so far, so I'll have to research this more to see how to fix the syntax.
 
Unless you are using "effects" (like slide in / slide out, fade in / fade out), the code the built in, predefined action produces isn't really necessary, as it deals with setting up and executing effects.

So the easiest way is just to use the straight forward hide() / show() in our element model. So have a function that you call on change (or click, or whatever) in a form_X.js file, call that as myFunc(this) from your element JS event, then stuff like ...

Code:
function myFunc(el) {
   var value = el.getValue();
   if (value === '1') {
      el.form.formElements.get('mytable___foo').hide();
   }
   else {
      el.form.formElements.get('mytable___foo').show();
   }
}

-- hugh
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top