this code does not create the frame I thought it would. It won't even reach the intended page, I have setup print statement there, it never printed. frames['ID'].location = "SwitchValidation.cfm?FieldName=ID&TransactionID=" + document.forms['Maintain'].elements['TransactionID'].value + "&Year=" + document.forms['Maintain'].elements['Year'].value + "&AcctNumberOrig=" + document.forms['Maintain'].elements['AcctNumberOrig'].value + "&ID=" + document.forms['Maintain'].elements['ID'].value + "&AmountOrig=" + document.forms['Maintain'].elements['AmountOrig'].value; What could be the cause? a similar code for a different process works just fine. What would be the way to make at least go to the SwitchValidation.cfm page?
What browser are you using? Firefox and chrome are both pretty good about reporting javascript errors. Is the print statement before or after that line? If it's before then there is something else causing the problem. To just make it go to SwitchValidation.cfm try leaving off the querystring, that would at least tell you if the error is happening while building the querystring. frames['ID'].location = "SwitchValidation.cfm";
I am testing in chrome, there is no error reported but it never reach the cfm page. I can alert before the frame code but not after, it seems it just went to never land. I will try the bare SwitchValidation.cfm. frames['ID'].location = "SwitchValidation.cfm";[/QUOTE] did not generate anything either, but if I just type in the URL for "http://..../SwitchValidation.cfm" that works just fine.
did not generate anything either, but if I just type in the URL for "http://..../SwitchValidation.cfm" that works just fine.[/QUOTE] What is real strange is now if I put frames['ID'].location = "SwitchFormValidation.cfm"; in a different function, it works but does not in this function.
Did you grab this code from somewhere else? It doesn't seem to me that you wrote this code yourself, because you're asking about a generated code from fields and values that might not be defined (Undef). One of those Code: .value s is probably undefined or null at the time the code reads the values. THIS here will work ALWAYS, as long as a frame named "ID" exists within the page containing this script: Code: frames['ID'].location = "SwitchValidation.cfm"; So, one of these here values: Code: document.forms['Maintain'].elements['TransactionID'].value document.forms['Maintain'].elements['Year'].value document.forms['Maintain'].elements['AcctNumberOrig'].value document.forms['Maintain'].elements['ID'].value document.forms['Maintain'].elements['AmountOrig'].value Is null or UNDEF. While in the page, run this here code in the location bar of the browser or in the JavaScript debug window without spaces: Code: javascript:alert(document.forms['Maintain'].elements['TransactionID'].value);alert(document.forms['Maintain'].elements['Year'].value);alert(document.forms['Maintain'].elements['AcctNumberOrig'].value);alert(document.forms['Maintain'].elements['ID'].value);alert(document.forms['Maintain'].elements['AmountOrig'].value); So make sure all those values contain something BEFORE running that statement, otherwise, make each value a default BEFORE the user picks from the form.
Thanks Swoly, I think I found the problem, I did not setup the onchange and onblur functions for the text boxes that should call the javascript funcition!