Thanks for your suggestion but it didn't work. The function fixQuotes gets the following:
Code:
formFloorPlan.cloneof.value=fixQuotes(Mona's Test Layout);
The apostrophe is causing an error. What I am expecting to happen is to have any apostrophes in the string replaced with double apostrophe, i.e. Mona''s Test Layout.
I don't really understand the order that things happen in your code. Is it that the page loads, you then request a variable from the server and that populates the field? Because if that's the case you would want to incorporate a callback function to make sure the data is available before trying to use it.
I'm sorry but I should have told you this from the beginning.
The page displays a floor plan of the offices that we occupy. This is just an image. The user can then click on a button that opens a popup window which allows the user to select a layout (or seating chart). When the layout has been selected the page is refreshed from the popup before the popup is closed. This is when the variable, dspLayoutName, is populated.
So the first time the page is loaded the variable is not populated and is causing the problem. I hope that this makes some sense and helps.
It seems to make sense. But why does the function need to run on page load if there is no data for it to work with? Is it not possible for it only to run once the user has closed the popup?
Yes, if I only knew how to do that. This is not my code but I have been asked to make it work. It was written over 10 years ago and my boss wants it revived. I haven't done any coding in years. I am a project manager but we are short handed.
Bookmarks