Solved

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

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Build an array called $myWeek which will hold the array elements Today, Yesterday and then builds up the rest of the week by the name of the day going back 1 week.   (CODE) (CODE) Then you just need to pass your date to the function. If i…
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…
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…
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…

895 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now