Jump to content
  • 0

Getelementsbyname In Update Form



I have a test script in a submit form which gets the latest text value of a dropdown and puts it into another field dynamically using onmouseover. Virtual2 has the dropdown table.



<script type="text/javascript" language="javascript">
document.getElementById('Submit').onmouseover = function()
var hour = (document.getElementById('cbParamVirtual2').value);

document.getElementById('InsertRecordLastallocagent').value = "Hello " + hour;



When I try to use a similar script in an Update form -

I change to "Insert" "Edit"

ElementById to ElementsByName [0]

and I've set up a checkbox Virtual2 which triggers the input to Lastallocagent

but it gives me "Hello" + the first (default) entry in the dropdown table in Virtual1 rather than changing to the agent I select from the dropdown



var hour = (document.getElementsByName('cbParamVirtual1')[0].value);

document.getElementById('cbParamVirtual2').onchange= function g_date()
document.getElementById('EditRecordLastallocagent').value = "hello" + hour;


I've been at it all day - any help would be appreciated




Link to comment
Share on other sites

1 answer to this question

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.

Answer this question...

×   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.

  • Create New...