Jump to content
  • 0

Default Choices in Dropdowns from Lookup Table


roattw

Question

This has been asked before but the answer didnt work.  I have a Lookup table being called in a Datapage.  I want one of the table choices to be the default.  It work fine using Custon Lookup table and not using the table.  Previous posts said add this to footer:

<script type="text/javascript">
function f_default(){
document.getElementById("FieldName").value = "TheDefualtVaule";
}
window.onload = f_default;
</script>

I have done this, referencing the correct field name and value but it doesn't work.  Thoughts?

Thanks as always.

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 0

Hi roattw,

What kind of datapage do you use and what kind of form element have you assigned to the field in which you would like to display default value?

This code works fine for submission form with default value assigned to a dropdown. 

<script type="text/javascript">
function f_default(){
document.getElementById("InsertRecordField_name").value = "Default";
}

document.addEventListener('DataPageReady', function (event) {
f_default();
       
});
</script>

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

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