Solved

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

Posted on 2013-05-19
4
517 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 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

Suggested Solutions

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…
Finding original email is quite difficult due to their duplicates. From this article, you will come to know why multiple duplicates of same emails appear and how to delete duplicate emails from Outlook securely and instantly while vital emails remai…
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

752 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