Jump to content
  • 0

Default Choices in Dropdowns from Lookup Table


ppbb123

Question

3 answers to this question

Recommended Posts

  • 0

You can use JS code to set the default value:

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

Put the code in the Footer of your DataPage. Remember to change "FieldName" and "TheDefualtVaule".

Link to comment
Share on other sites

  • 0

Just in case it's helpful to anyone else, I tried this and it initially didn't work because I was on a submission form.  Once I added "InsertRecord" in front of "FieldName" it worked like a charm.  

Link to comment
Share on other sites

  • 0

I spoke too soon.  When I tried to save the datapage I got the Window Onload error.  Here's what I wound up with:

 

<script type="text/javascript">
function f_default(){
document.getElementById("InsertRecordFieldName").value = "DefaultValue";
}
</script>
<script type="text/javascript">
document.addEventListener('DataPageReady', function (event) {
f_default()  
});
</script>

 

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