Jump to content

More Java Script Help


Recommended Posts

I have two Java Scripts:

******************************************************************************************************************************************************

1)

function concatenate()

{

var position1 = document.getElementById("EditRecordLast_Name").value;

var position2 = document.getElementById("EditRecordHOH_ID").value;

var allpositions = position1 +" ID:" + position2;

document.getElementById("EditRecordStudent_Last_Name_ID").value = allpositions;

}

document.getElementById("caspioform").onsubmit=concatenate;

******************************************************************************************************************************************************

2)

function f_submit()

{

document.getElementById("caspioform").submit();

}

window.onload = f_submit;

******************************************************************************************************************************************************

I can put script (1) in an html block or footer and it works perfectly. But if I add the auto-submit sctipt (2) in the footer it makes script1 quit working.

I need for script one to work with the auto-submit script. Is there a way to make them work together ?

Thanks in advance for your assistance :)

Link to comment
Share on other sites

Hi,

Script (1) quit working because Script (2) submit form in the moment when the form loaded, so the Script (1) doesn't have time to work :)

Insert following script into the footer

<SCRIPT LANGUAGE="JavaScript">

window.onload = function()
{
var position1 = document.getElementById("EditRecordLast_Name").value;
var position2 = document.getElementById("EditRecordHOH_ID").value;

var allpositions = position1 +" ID:" + position2;

document.getElementById("EditRecordStudent_Last_Name_ID").value = allpositions;
document.getElementById("caspioform").submit();
}

</SCRIPT>

Let me know if this helps.

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...