Solved

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

Posted on 2013-05-19
4
514 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
  • 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 83

Accepted Solution

by:
Dave Baldwin earned 500 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

713 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