DCL3
asked on
Javascript question: What's the difference in these scripts?
I have these two pages and one is functioning properly and the other will not resolve to the preview page. I am stumped as to why the script (which has alot more question fields on it, I know) is not working. Please show me what I am doing wrong or what I have left out. prototype.js preview.html le.worshop.staff.observation.for.html hospital.emergency.contacts.html
preview.html
preview.html
ASKER
ok, this is the one that is working (displaying correctly once you click on the preview button) correctly..
In other words, the information I enter on this page...
http://www.showmethesite.com/dhec/le.worshop.staff.observation.form.html
is showing up fine and displaying: the form properly on this page..
http://www.showmethesite.com/dhec/preview.html
However, when I try to use the same script (but modified for this page's contents)on this page
http://www.showmethesite.com/dhec/hospitalcontacts/hospital.emergency.contacts.html
It does not display the page nor the populated fields on this page..
http://www.showmethesite.com/dhec/hospitalcontacts/preview.html
In other words, the information I enter on this page...
http://www.showmethesite.com/dhec/le.worshop.staff.observation.form.html
is showing up fine and displaying: the form properly on this page..
http://www.showmethesite.com/dhec/preview.html
However, when I try to use the same script (but modified for this page's contents)on this page
http://www.showmethesite.com/dhec/hospitalcontacts/hospital.emergency.contacts.html
It does not display the page nor the populated fields on this page..
http://www.showmethesite.com/dhec/hospitalcontacts/preview.html
Both forms are giving this error every second
Error: element is null
Source File: http://cdn.uservoice.com/javascripts/application_packaged.js?1294188324
Line: 491
Could it be a missing submit button?
Error: element is null
Source File: http://cdn.uservoice.com/javascripts/application_packaged.js?1294188324
Line: 491
Could it be a missing submit button?
ASKER
well, the preview button at the bottom works with the script and changing it will cause it not to function is what I have experienced. If you see a better more workable solution then please suggest. My main issue is that
This page:
http://www.showmethesite.com/dhec/hospitalcontacts/hospital.emergency.contacts.html
It does not display the page nor the populated fields on this page..
http://www.showmethesite.com/dhec/hospitalcontacts/preview.html
You have always been great to help me in the past so whatever suggestion you have I am open to..
This page:
http://www.showmethesite.com/dhec/hospitalcontacts/hospital.emergency.contacts.html
It does not display the page nor the populated fields on this page..
http://www.showmethesite.com/dhec/hospitalcontacts/preview.html
You have always been great to help me in the past so whatever suggestion you have I am open to..
When I click preview I get
Error: $("haOCname") is null
Source File: http://www.showmethesite.com/dhec/hospitalcontacts/hospital.emergency.contacts.html
Line: 2228
<input name="haOCname" type="text" id="haMDname" size="40" />
You need to change to
<input name="haOCname" type="text" id="haOCname" size="40" />
Error: $("haOCname") is null
Source File: http://www.showmethesite.com/dhec/hospitalcontacts/hospital.emergency.contacts.html
Line: 2228
<input name="haOCname" type="text" id="haMDname" size="40" />
You need to change to
<input name="haOCname" type="text" id="haOCname" size="40" />
ASKER
ok, that is now done.
http://www.showmethesite.com/dhec/hospitalcontacts/hospital.emergency.contacts.html
http://www.showmethesite.com/dhec/hospitalcontacts/hospital.emergency.contacts.html
ASKER
I am still not getting anything on the preview page.....
What could the issue still be?
What could the issue still be?
Perhaps more of the same. The form is a monster. I'll look in an hour or so
ASKER
thanks for looking at it...I'll await your reply..
Open the page in Firefox, click the preview and the error console will show you a lot
Error: $("hdlabPCname") is null
Source File: http://www.showmethesite.com/dhec/hospitalcontacts/hospital.emergency.contacts.html
Line: 2322
which means
<input name="hdlabPCname" type="text" id="adminoncall33" size="40" />
is wrong
and while I looked I saw the next field was also wrong:
<input name="hdlabLSOCname" type="text" id="adminoncall33" size="40" />
Ditto
<input name="hdedPECname" type="text" id="adminoncall33" size="40" />
<input name="hdedSECname" type="text" id="adminoncall33" size="40" />
Ditto
<input name="hdmsPECname" type="text" id="adminoncall33" size="40" />
<input name="hdmsOCSname" type="text" id="adminoncall33" size="40" />
and this is not correct either
<input name="\hdmsOCSemail" type="text" id="\hdmsOCSemail" size="40" />
you need to remove the \
and here are more
<input name="hdmsSSCname" type="text" id="adminoncall33" size="40" />
<input name="hdmsTRANSLATEname" type="text" id="adminoncall33" size="40" />
<input name="hdcmrcleCPCname" type="text" id="adminoncall33" size="40" />
<input name="hdcmrcleCNTYPCname" type="text" id="adminoncall33" size="40" />
<input name="hdcmrcleSHERCONname" type="text" id="adminoncall33" size="40" />
<input name="hdcmrcleEODname" type="text" id="adminoncall33" size="40" />
<input name="hdcmrcleOLAWEname" type="text" id="adminoncall33" size="40" />
<input name="hdcmrcCORONERname" type="text" id="adminoncall33" size="40" />
<input name="hdfireVOLFDname" type="text" id="adminoncall33" size="40" />
<input name="hdemscCOUNTYEMSname" type="text" id="adminoncall33" size="40" />
<input name="hdemscCITYEMSname" type="text" id="adminoncall33" size="40" />
<input name="hdemscAMBULANCEname" type="text" id="adminoncall33" size="40" />
<input name="hdemscPRIVAMBULANCEP ROVname" type="text" id="adminoncall33" size="40" />
<input name="hdlphcHDname" type="text" id="adminoncall33" size="40" />
<input name="hdlphcPUNHEALTHPREPn ame" type="text" id="adminoncall33" size="40" />
<input name="hdlphcEPIDDIVISname" type="text" id="adminoncall33" size="40" />
<input name="hdlphcEHname" type="text" id="adminoncall33" size="40" />
<input name="hdsphcCOMMofHEALTHna me" type="text" id="adminoncall33" size="40" />
<input name="hdsphcPUBHEALTHPREPA RDNESSname " type="text" id="adminoncall33" size="40" />
<input name="hdsphcEPIDDIVname" type="text" id="adminoncall33" size="40" />
<input name="hdsphcENVIROHEALTHna me" type="text" id="adminoncall33" size="40" />
<input name="hdempcCOUNTYname" type="text" id="adminoncall33" size="40" />
<input name="hdempcCITYname" type="text" id="adminoncall33" size="40" />
<input name="hdempcSTATEname" type="text" id="adminoncall33" size="40" />
<input name="hdempcOTHERCONname" type="text" id="adminoncall33" size="40" />
<input name="hdahcHOSPITALname" type="text" id="adminoncall33" size="40" />
<input name="hdahcEROOM1name" type="text" id="adminoncall33" size="40" />
<input name="hdahcHOSPITAL2name" type="text" id="adminoncall33" size="40" />
<input name="hdahcEROOM2name" type="text" id="adminoncall33" size="40" />
<input name="hdahcHOSPITAL3name" type="text" id="adminoncall33" size="40" />
<input name="hdahcEROOM3name" type="text" id="adminoncall33" size="40" />
I think there is a cut and paste issue here, no?
Error: $("hdlabPCname") is null
Source File: http://www.showmethesite.com/dhec/hospitalcontacts/hospital.emergency.contacts.html
Line: 2322
which means
<input name="hdlabPCname" type="text" id="adminoncall33" size="40" />
is wrong
and while I looked I saw the next field was also wrong:
<input name="hdlabLSOCname" type="text" id="adminoncall33" size="40" />
Ditto
<input name="hdedPECname" type="text" id="adminoncall33" size="40" />
<input name="hdedSECname" type="text" id="adminoncall33" size="40" />
Ditto
<input name="hdmsPECname" type="text" id="adminoncall33" size="40" />
<input name="hdmsOCSname" type="text" id="adminoncall33" size="40" />
and this is not correct either
<input name="\hdmsOCSemail" type="text" id="\hdmsOCSemail" size="40" />
you need to remove the \
and here are more
<input name="hdmsSSCname" type="text" id="adminoncall33" size="40" />
<input name="hdmsTRANSLATEname" type="text" id="adminoncall33" size="40" />
<input name="hdcmrcleCPCname" type="text" id="adminoncall33" size="40" />
<input name="hdcmrcleCNTYPCname" type="text" id="adminoncall33" size="40" />
<input name="hdcmrcleSHERCONname"
<input name="hdcmrcleEODname" type="text" id="adminoncall33" size="40" />
<input name="hdcmrcleOLAWEname" type="text" id="adminoncall33" size="40" />
<input name="hdcmrcCORONERname" type="text" id="adminoncall33" size="40" />
<input name="hdfireVOLFDname" type="text" id="adminoncall33" size="40" />
<input name="hdemscCOUNTYEMSname"
<input name="hdemscCITYEMSname" type="text" id="adminoncall33" size="40" />
<input name="hdemscAMBULANCEname"
<input name="hdemscPRIVAMBULANCEP
<input name="hdlphcHDname" type="text" id="adminoncall33" size="40" />
<input name="hdlphcPUNHEALTHPREPn
<input name="hdlphcEPIDDIVISname"
<input name="hdlphcEHname" type="text" id="adminoncall33" size="40" />
<input name="hdsphcCOMMofHEALTHna
<input name="hdsphcPUBHEALTHPREPA
<input name="hdsphcEPIDDIVname" type="text" id="adminoncall33" size="40" />
<input name="hdsphcENVIROHEALTHna
<input name="hdempcCOUNTYname" type="text" id="adminoncall33" size="40" />
<input name="hdempcCITYname" type="text" id="adminoncall33" size="40" />
<input name="hdempcSTATEname" type="text" id="adminoncall33" size="40" />
<input name="hdempcOTHERCONname" type="text" id="adminoncall33" size="40" />
<input name="hdahcHOSPITALname" type="text" id="adminoncall33" size="40" />
<input name="hdahcEROOM1name" type="text" id="adminoncall33" size="40" />
<input name="hdahcHOSPITAL2name" type="text" id="adminoncall33" size="40" />
<input name="hdahcEROOM2name" type="text" id="adminoncall33" size="40" />
<input name="hdahcHOSPITAL3name" type="text" id="adminoncall33" size="40" />
<input name="hdahcEROOM3name" type="text" id="adminoncall33" size="40" />
I think there is a cut and paste issue here, no?
ASKER
Ok, file id have been corrected as well as the \ error...still no display on the preview page.
ASKER
I just open the page in Firefox and no error but no display either..it just says my message "Please wait whiole page is loading..." But it should load instantly with the data.
I still see
<input name="haOCname" type="text" id="haMDname" size="40" />
<input name="haOCname" type="text" id="haMDname" size="40" />
I also found
mywin.document.getElementB yId('previ ew_hdmsOCS page').inn erHTML = $("hdmsOCSpage").value;
which should be
mywin.document.getElementB yId('previ ew_hdmsOCS pager').innerHTML = $("hdmsOCSpager").value;
mywin.document.getElementB
which should be
mywin.document.getElementB
ASKER
ok, thanks I fixed that one..what else do you see?
and
mywin.document.getElementB yId('previ ew_hdmsTRA NSLATEcell ').innerHT ML = $("preview_hdmsTRANSLATEce ll").value ;
which should be
mywin.document.getElementB yId('previ ew_hdmsTRA NSLATEcell ').innerHT ML = $("hdmsTRANSLATEcell").val ue;
mywin.document.getElementB
which should be
mywin.document.getElementB
NOW it works!
So it was not really code issue, just a data-entry quality control issue
ASKER
Ok, I cleaned up all the errors and it is NOW displaying!! Yea!!!!!!!!! All I need to know is how I get it to preview in the same format (colored tables and rows..so it doesn't just display on a white form) as the form they filled it out on. I just don't wanna screw things up at this point.
start by fixing your html
it is to be mildly said DISGUSTING!
If I format it, you can see how bad it is:
<tr>
<td valign="top" nowrap="nowrap">
<div align="right">
<span class="style13">
<span class="style12">Office:&nb sp;
<span id="preview_haEMoffice">
</div>
</td>
<td valign="top" nowrap="nowrap">
<div align="right">
<span class="style13">
<span class="style12">Office:&nb sp;
<span id="preview_haSOoffice">
</div>
</td>
</tr>
VERY invalid and amazing it shows anything
How about
<tr>
<td valign="top" nowrap="nowrap" class="style13">
<span class="style12">Office:&nb sp; </span>
<span id="preview_haEMoffice"></ span>
</td>
<td valign="top" nowrap="nowrap" align="right" class="style13">
<span class="style12">Office:&nb sp; </span>
<span id="preview_haSOoffice"></ span>
</td>
</tr>
???
it is to be mildly said DISGUSTING!
If I format it, you can see how bad it is:
<tr>
<td valign="top" nowrap="nowrap">
<div align="right">
<span class="style13">
<span class="style12">Office:&nb
<span id="preview_haEMoffice">
</div>
</td>
<td valign="top" nowrap="nowrap">
<div align="right">
<span class="style13">
<span class="style12">Office:&nb
<span id="preview_haSOoffice">
</div>
</td>
</tr>
VERY invalid and amazing it shows anything
How about
<tr>
<td valign="top" nowrap="nowrap" class="style13">
<span class="style12">Office:&nb
<span id="preview_haEMoffice"></
</td>
<td valign="top" nowrap="nowrap" align="right" class="style13">
<span class="style12">Office:&nb
<span id="preview_haSOoffice"></
</td>
</tr>
???
Why not just copy the input form, but make the fields readonly and borderless
ASKER
Doesn't work to do that b/c the preview need the field to be specifically this format in order to read correctly <span id="preview_haEMname">
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
ok, great! It works awesome!! You are the best man!! I always appreciate you prompt accurate help!!
ASKER
mplungjan is the BEST!!
:) Happy New year
Also please be more specific as to what is not working? validation, display, effects?
Did you try loading them into firefox and look in the error console?