I'm using Joomla and third party content manager which runs on taoj_contentmanager.1.0.4
In the contentmanager a user can create an article which must have a "Introtext" (this is checked by the JCE editor).
They can also fill in a Fulltext, in my case I want to user to always enter a fulltext so I want to create a check to make sure the fulltext isnt blank before saving.
I assumed this wouldn't be to difficult to do with a little bit of Javascript but as always, it seems more difficult then I expected.
In the FORM which handles it all the following Iframe is loaded:
<iframe frameborder="0" id="jxform[fulltext]_ifr" src="javascript:""" style="width: 100%; height: 137px;"></iframe>
In the iFrame the following code is loaded
<html><head xmlns=" content="IE=7" http-equiv="X-UA-Compatible"><meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
<Loads of javascript files and code>
</head>
<body class="mceContentBody " id="tinymce" spellcheck="false" dir="ltr"><br _mce_bogus="1"></body>
I make sure my own javascript is loaded formcheck.js. As I said my goal is to check if the HTML in the body tag get's changed/isn't empty.
For now though creating an alert that displays the content of the body in the iframe is more then enough...
1 step at a time
I tried a lot of different approaches but I ended with this:
function checkForm() {
var form = document.getElementById["jxform[fulltext]_ifr"];
if(form == null) alert('form not found');
}
and this:
function checkForm() {
var form = document.adminForm;
if(form == null) alert('form not found');
var message = document.form["jxform[fulltext]_ifr"].body.innerHTML;
alert(message);
}
The above code doesn't work (obviously), so I'm hoping someone can help me out.
What's the right syntax to "call" the iFrame, it has the following id: jxform[fulltext]_ifr
What's the right syntax to "call/display" the content of a ID element that has square brackets in it's name?
I found the following solution: [jibbering.com...] but I can't get it to work.
With kind regards,
George
In the contentmanager a user can create an article which must have a "Introtext" (this is checked by the JCE editor).
They can also fill in a Fulltext, in my case I want to user to always enter a fulltext so I want to create a check to make sure the fulltext isnt blank before saving.
I assumed this wouldn't be to difficult to do with a little bit of Javascript but as always, it seems more difficult then I expected.
In the FORM which handles it all the following Iframe is loaded:
<iframe frameborder="0" id="jxform[fulltext]_ifr" src="javascript:""" style="width: 100%; height: 137px;"></iframe>
In the iFrame the following code is loaded
<html><head xmlns=" content="IE=7" http-equiv="X-UA-Compatible"><meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
<Loads of javascript files and code>
</head>
<body class="mceContentBody " id="tinymce" spellcheck="false" dir="ltr"><br _mce_bogus="1"></body>
I make sure my own javascript is loaded formcheck.js. As I said my goal is to check if the HTML in the body tag get's changed/isn't empty.
For now though creating an alert that displays the content of the body in the iframe is more then enough...
1 step at a time
I tried a lot of different approaches but I ended with this:
function checkForm() {
var form = document.getElementById["jxform[fulltext]_ifr"];
if(form == null) alert('form not found');
}
and this:
function checkForm() {
var form = document.adminForm;
if(form == null) alert('form not found');
var message = document.form["jxform[fulltext]_ifr"].body.innerHTML;
alert(message);
}
The above code doesn't work (obviously), so I'm hoping someone can help me out.
What's the right syntax to "call" the iFrame, it has the following id: jxform[fulltext]_ifr
What's the right syntax to "call/display" the content of a ID element that has square brackets in it's name?
I found the following solution: [jibbering.com...] but I can't get it to work.
With kind regards,
George