Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generic placeholder setting not working #126

Open
pthurmond opened this issue Feb 19, 2014 · 4 comments
Open

Generic placeholder setting not working #126

pthurmond opened this issue Feb 19, 2014 · 4 comments

Comments

@pthurmond
Copy link

I set the generic placeholder and the character as well when I pass in the value. But it still fails to use that set placeholder that you pass in.

Example:
new Skeuocard($("#skeuocard"), {
cardNumberPlaceholderChar: 'X',
genericPlaceholder: 'Enter Card Here'
});

Still just shows X's.

@csexton
Copy link

csexton commented Apr 12, 2014

@pthurmond I had the same problem. I was able to hack this by adding:

$(@_inputViews.number.el).find("input").attr("placeholder", @options.genericPlaceholder)

To Skeuocard.coffee on Line 373.

Or if you want the js version for skeuocard.js:

$(this._inputViews.number.el).find("input").attr("placeholder", this.options.genericPlaceholder)

This is clearly a hack, but lets me set the generic placeholder.

@csexton
Copy link

csexton commented Apr 12, 2014

@kenkeiter I would be up for submitting a PR with a fix for this issue, but wasn't sure the best way to handle this. Seems like a couple of approaches could be to:

  1. Tell the SegmentedCardNumberInputView to use the genericPlaceholder when there is no product. Kinda like this hack, but in a cleaner way. Perhaps we could add a method to the class to set the placeholder to the genericPlaceholder
  2. Let the SegmentedCardNumberInputView infer that it should use the genericPlaceholder if there is only one value in the grouping array
  3. Pass the product to the SegmentedCardNumberInputView so it can decide based on that.

Thoughts?

@jackspirou
Copy link
Collaborator

@kenkeiter @csexton I am in a battle with the same issue, but it seems to be working here: http://jsfiddle.net/dv9c9/

@csexton please submit a fix!

@catgeek86
Copy link

Here's another hack:
Added to lines 854-857 of skeuocard.js In this case, it makes the initial placeholder "Enter Card Number"
if (groupings.length == 1 ) {
groupEl.attr({placeholder: "Enter Card Number"});
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants