1779 Posts in 582 Topics by 556 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 940 Views |
-
Tab Ordering on a PHP created Form

27 January 2011 at 11:01pm
how can i set the tab order on a form that is creating in a php file.
I can't tab through the credit card field ...it keeps jumping on to cvv2Number.
Here's my code
function getPaymentFormFields() {
$mt = array('mm','01','02','03','04','05','06','07','08','09','10','11','12');
// lil loop so $yr will always contain this year +/- 5 years;
$yr = array(0=>'yyyy');
for ($x = (date('Y') - 5); $x <= date('Y') + 5; $x++) {
$yr[$x] = $x;
}
$issu = array('01','02','03','04','05');
$cardvalue = array('0','1','9','S','8');
$cardname = array(
'Visa' => 'Visa',
'MasterCard'=> 'MasterCard',
'Switch' => 'Switch',
'Solo' => 'Solo',
'Other' => 'Other'
);return new FieldSet(
new DropdownField('creditCardType','Card Type', $cardname, $cardvalue),
new CreditCardField("CreditCardNumber", "Credit Card Number:"),
new DropdownField('expDateMonth','Expiration Date', $mt, $mt),
new DropdownField('expDateYear','', $yr, $yr),
new LiteralField("extrafields", '<div id="extrafields" style="display:none;">'),
new DropdownField('startDateMonth','Start Date', $mt, $mt),
new DropdownField('startDateYear','', $yr, $yr),
new DropdownField('cardIssue','Issue No', $issu, $issu),
new LiteralField("extrafields", '</div>'),
new NumericField("cvv2Number", "Card Verification Number:", "", 3),
new LiteralField("cvv2img", '<img src="/themes/winderworld/images/cvv2.gif" id="cvvimage" alt="cvv2" />'));
} -
Re: Tab Ordering on a PHP created Form

27 January 2011 at 11:49pm
The tab order will be in the order that the fields are rendered I believe, you could create your FormField items and ->setTabIndex() manually on each one.
-
Re: Tab Ordering on a PHP created Form

28 January 2011 at 1:20am
Thanks, i saw that in docs but not sure how and where i'd use it exactly
new DropdownField('creditCardType','Card Type', $cardname, $cardvalue),
creditCardType->setTabIndex(99)
I usedjQuery in the end, which saved altering php, but a little example of setTabIndex in use would help.
| 940 Views | ||
|
Page:
1
|
Go to Top |


