Jump to content

Recommended Posts

I'm stuck on getting the below code to work for a project I'm working on. Not sure if this is in the right location or not and if it isn't I apologize. I'm needing a yes/no option. If yes it will display certain options from them to choose from (NaYes) and if no is select it should display the campus options (NaNo).

<form name="CoharieTribe">

        <select  id="coharietribe" id="second" class="package"  title="Search in"size="1">

        <option selected="selected">Are you a member or affiliated with the Coharie Tribe?</option>

                <option class="dropdown" value="yes">Yes</option>

                <option class="dropdown" value="no">No</option>
        </select>
        </form>

<!-- Yes Option -->

        <form name="NaYes">

        <select  id="yes" class="searchSelect"  title="Search in"size="1" onChange="goNaYes()">

         <option selected="selected">Select Option</option>
                        <option value="www.placeyourorderhere.com">I am a new student placing an order for the first time</option>

                        <option value="www.placeyourorderhere.com">I am a returning student</option>

                         <option value="www.placeyourorderhere.com">I need to renew my background check</option>

                        <option value="www.placeyourorderhere.com">I need a drug test</option>

        </select>

        </form>


<!-- No Option -->

        <form name="NaNo">

        <select  id="nurse" id="second" class="package"  title="Search in"size="1">
                                  
        <option selected="selected">Please select your campus:</option>

                <option class="dropdown" value="UNC">University of North Carolina</option>

                <option class="dropdown" value="UVA">University of Virginia</option>

                <option class="dropdown" value="CO">colorado University</option>

        </select>

        </form>
Link to comment
https://forums.phpfreaks.com/topic/302446-help-with-prompt-option/
Share on other sites

Do you plan to use plain JavaScript, jQuery, etc.?

 

With plain JavaScript, yYou can try something like the following:

http://www.aspsnippets.com/Articles/Show-Hide-DIV-with-TextBox-based-on-DropDownList-Selected-Value-Selection-using-JavaScript-and-jQuery.aspx

 

 

Of course, you may want to make some tweaks so the forms still work for visitors who have JavaScript disabled. You can do this by showing all the forms up front. Then use JavaScript to hide the content you don't want displayed until Yes or No is selected.

Edited by cyberRobot
Looking at the link again, it shows a plain JavaScript solution along with a jQuery version
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

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

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.