Wix Forum Logo
  • Community Forum

  • Support

  • Members

  • Groups List

  • Blog

  • More

    Use tab to navigate through the menu items.
    To see this working, head to your live site.
    • Categories
    • All Posts
    • My Posts
    Ben Smith
    Jul 29, 2020

    If Input Field is Hidden Then Assign it a Value

    in Forum Discussions


    Hello Everyone,

    I hope what I am asking is simple. I have a function that hides an input if a certain choice is selected. If the input is hidden is there a way for me to assign it a value like 1 or 0 automatically. Below is my working code that hides the input field. Just not sure what to add to give it a value of 1 or 0 if it's hidden. I want it to be 1 or 0 after the form is submitted so it has a value and isn't just blank in my database. export function dropdown3_change(event) { let selectedIndex = $w("#dropdown3").selectedIndex; if (selectedIndex === 1) { $w("#input1").hide() } else { $w("#input1").show() } } Thank you! Any help would be greatly appreciated!

    1 answer0 replies
    1 Comment

    Share Your ThoughtsSign up to leave a comment.

    G
    Greta Galubauskaitė
    Jul 30, 2020

    Hi, this is a forum for Wix Forum application matters. Please try finding your answer here: https://support.wix.com/en/ or reach out to support@wix.com.

    1
    1 comments
    Similar Posts
    • Major Issues with User Inputs... Values are disappearing
    • URL Input Field
    • Text Input Field Page Navigation

    WIX FORUM

    Create an online community right on your site with Wix Forum. Your visitors can become members, join conversations, follow posts, leave comments and more. Plus, you can choose from beautiful layouts and customize to get the look you love. And it’s completely free! 

     

    © 2006 - 2020 Wix.com, Inc 

    COMPANY

    About Wix

    Terms of Use

    Privacy Policy

    SUPPORT

    Help Center

    Contact Us

    ​

    • Black Facebook Icon
    • Black Twitter Icon
    • Black YouTube Icon
    • Black Pinterest Icon
    • Black Instagram Icon
    • Black LinkedIn Icon