#beastboy_code
1 messages ยท Page 1 of 1 (latest)
๐ Welcome to your new thread!
โฒ๏ธ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
๐ This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1227640749596741796
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
- beastboy_customer-defaultpm, 22 hours ago, 14 messages
- beastboy_code, 4 days ago, 44 messages
- beastboy_docs, 5 days ago, 14 messages
As far as I am aware it is not possible to completely hide those like this but I am lookin in to it. Can you tell me a bit more about what you are trying to do here?
I would like to hide the input labels above the inputs. I know this is possible because I've seen other websites that use stripe do it - can provide screenshots if you'd like
As well as hiding the country input as we can default populate it with USA
If you can link to the sites that would help, I will consult my colleagues on this
Hiding fields and default values is a different part of Stripe.js we have them documented in the reference here
https://docs.stripe.com/js/elements_object/create_payment_element#payment_element_create-options-defaultValues
https://docs.stripe.com/js/elements_object/create_payment_element#payment_element_create-options-fields
okay let me get those to you
okay I was able to hide the boxes
but now how do I hide the labels?
Hello! I'm taking over and catching up...
If you want to mimic what someone else is doing on their site your best approach is to examine their code to see how they're doing it.
How is that possible lol
Can you teach me to inspect embedded stripe code to see how they're rendering it to not display the labels?
You use your browser's dev tools to view the code they're using.
I can't provide specific guidance beyond that, but you can find tutorials on the web that cover browser dev tools and how to use them.
So you don't know how to hide the labels?
The labels are not designed to be hidden, and I do not recommend you hide them.
Could you kindly advise how to hide it even if you don't recommend it
No, sorry.
const elementOptions = {
fields: {
billingDetails: {
address: {
country: 'never',
},
},
},
terms: {
card: 'never',
},
rules: {
'.Label': {
fontSize: 0,
},
},
appearance: {
labels: 'floating',
},
};
var paymentElementNew = elements?.create(
'payment' as any,
elementOptions as any,
);
Would you know why the labels aren't floating?
even though I specify it here
It makes no change
Actually I got it, just set fontsize of label to 0 ๐
Okay.
If you appreciate that information at all, of course