Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Replace HTML Select / drop-down list by a single option only

Posted on 2013-05-19
4
Medium Priority
?
526 Views
Last Modified: 2013-05-19
Hi Experts:

I have a HTML Select / drop-down list given by this code:

            <div class="fields">
                <label for="ddlMethod">Method Type</label>
                <select id="ddlMethod" name="ddlMethod" style="width:140px;">
                <option value="ProcessPayment">ProcessPayment</option>
                <option value="CreateTokenCustomer">CreateTokenCustomer</option>
                <option value="UpdateTokenCustomer">UpdateTokenCustomer</option>
                <option value="TokenPayment">TokenPayment</option>
                </select>
            </div>

Open in new window


I want to remove this code and replace it by the code that will set ddlMethod to ProcessPayment?

Regards,
Leigh
0
Comment
Question by:LeighWardle
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 42

Expert Comment

by:sedgwick
ID: 39180138
what do u mean set ddlMethod to ProcessPayment?
currently, the drop down list displays ProcessPayment cause its the first in the list.
0
 
LVL 1

Author Comment

by:LeighWardle
ID: 39180147
I don't want the user to see the drop-down at all - I just want the code to behave as though the user had selected ProcessPayment.
0
 
LVL 84

Accepted Solution

by:
Dave Baldwin earned 2000 total points
ID: 39180152
Get rid of that whole section and use a hidden input.
<input type="hidden" id="ddlMethod" name="ddlMethod"  value="ProcessPayment">

Open in new window

0
 
LVL 42

Expert Comment

by:sedgwick
ID: 39180155
so use label instead:
<label for="ddlMethod">Method Type: ProcessPayment</label>

Open in new window

0

Featured Post

The top UI technologies you need to be aware of

An important part of the job as a front-end developer is to stay up to date and in contact with new tools, trends and workflows. That’s why you cannot miss this upcoming webinar to explore the latest trends in UI technologies!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When it comes to write a Context Sensitive Help (an online help that is obtained from a specific point in state of software to provide help with that state) ,  first we need to make the file that contains all topics, which are given exclusive IDs. …
Find out what you should include to make the best professional email signature for your organization.
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

715 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question