J
Jon
All,
I'm currently working with a PHP-based CMS application, and am begining to
put the finishing touches on it via Javascript validation. Currently, I'm
using fairly standard methods of validation of each form field, the
algorithm is much like:
if(document.formName.field.value == ""){
//throw an error and return false
}
This works great except for one particular field. I have a javascript-based
Rich Text Editor (RTE) that currently places the body of each page within an
iFrame. When the page loads, I populate a field within the iFrame that is a
textarea with data coming from the DB (MySQL). All works fine this way, and
when the user makes a change and clicks submit, I'm able to get that data
from the form and submit.
The problem comes up with two things - building a preview page, and
validating data within the field. The algorithm I'm using above will work
within the field, however it will only give me the ORIGINAL value of the
textarea field. If the user changes it, I'm simply unable to grab the NEW
value of the field. As all of my other field validation works fine, I'm
assuming this has something to do with the iFrame.
So, can anyone give me some info on how I can grab CURRENT values of a
textarea field within an iFrame? Currently, any changes made within the
textarea (inside the iFrame) simply are not recognized by normal javascript
Validation. I'm somewhat of a JS newb, but can work off any any algorithm -
so at this point, ANY help is appreciated. Thank you in advance.
I'm currently working with a PHP-based CMS application, and am begining to
put the finishing touches on it via Javascript validation. Currently, I'm
using fairly standard methods of validation of each form field, the
algorithm is much like:
if(document.formName.field.value == ""){
//throw an error and return false
}
This works great except for one particular field. I have a javascript-based
Rich Text Editor (RTE) that currently places the body of each page within an
iFrame. When the page loads, I populate a field within the iFrame that is a
textarea with data coming from the DB (MySQL). All works fine this way, and
when the user makes a change and clicks submit, I'm able to get that data
from the form and submit.
The problem comes up with two things - building a preview page, and
validating data within the field. The algorithm I'm using above will work
within the field, however it will only give me the ORIGINAL value of the
textarea field. If the user changes it, I'm simply unable to grab the NEW
value of the field. As all of my other field validation works fine, I'm
assuming this has something to do with the iFrame.
So, can anyone give me some info on how I can grab CURRENT values of a
textarea field within an iFrame? Currently, any changes made within the
textarea (inside the iFrame) simply are not recognized by normal javascript
Validation. I'm somewhat of a JS newb, but can work off any any algorithm -
so at this point, ANY help is appreciated. Thank you in advance.