VVMustang Posted August 27, 2010 Report Share Posted August 27, 2010 I have a script that appears to be written correctly. I cannot find any reason why it should not work. However it is not receiving or submitting a parameter. The variables prehtml and posthtml appear in the table in the field NewsTitleformatted, but the text from NewsTitle is missing. For example, if the data for NewsTitle is entered as Promotion Received, the data in the NewsTitleformatted field appears as . The "Promotion Received" text is not there. The script is: function Headline() { var between = document.getElementById("InsertRecordNewsTitle").value; var prehtml = ""; var posthtml = ""; var bold = prehtml + between + posthtml; document.getElementById("InsertRecordNewsTitleformatted").value=bold; } document.getElementById("caspioform").onsubmit=Headline(); Quote Link to comment Share on other sites More sharing options...
Barbara Posted August 27, 2010 Report Share Posted August 27, 2010 I would add two lines of code to the script in order to display the variable contents while running. This is one way of debugging. <SCRIPT language="JavaScript"> function Headline() { var between = document.getElementById("InsertRecordNewsTitle").value; alert(between); var prehtml = "<font size=4><strong>"; var posthtml = "</strong></font>"; var bold = prehtml + between + posthtml; alert(bold); document.getElementById("InsertRecordNewsTitleformatted").value=bold; } document.getElementById("caspioform").onsubmit=Headline; </SCRIPT> Replace this code in your page (place the code in an HTML block at the bottom of the DataPage elements) and run the form and see what you get for those variables? I also removed the parentheses where you call the function. Maybe this helps. Cheers, Barbara Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.