last day (14 days later) » 

9:18 AM
0
A: Hide submit button for PayPal payment form if input field is not 40 characters

pshyoulostI went ahead a fixed up all your code. Change your form to this... <form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top"> <input type="hidden" name="cmd" value="_s-xclick"> <input type="hidden" name="hosted_button_id" value="BHQLX7V2W2GJQ"> <table> <tr><td><input ty...

 
It half works - any way to disable submitting the form using the enter button?
 
@RAStudios I updated the code. Choose my answer as the correct one if it is.
 
It didn't work - anyways I have added a new version of my form which is simplified if you can take a look.
 
Do you have jquery? @RAStudios
 
Yes, I do, does your code require it?
 
9:18 AM
@RAStudios it does. But which form do you want me to use? Would you like me to redo the things I did to your old form to the new one that you posted?
 
Yes please, that would be great
 
Tell me when you're here
 
Hi
 
Yo
Okay so I fixed the code and I updated it
Tell me if that works
 
alright cool will do
 
9:19 AM
And what exactly didn't work about it previously?
 
The button currently never shows up
 
the updated one I posted?
 
Yeah
 
The button doesn't show up?
Or it doesn't hide?
 
It never shows up
 
9:21 AM
Okay
one second
Do you see this part in your code?
<script data-rocketsrc="assets/js/jquery-2.1.1.min.js" type="text/rocketscript"></script>
 
I'm using this: <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js"></script>
 
Would it be psosible to get the link to your website?
Do you have
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js"></script>
right above the </head> tag?
 
Yes I do, my site is: ipwnstore.me/enterudid.html
The enter key works but the button doesn't show up
 
Yeah
do me a favor and take out style="display:none;"
from the form
and add this into the javascript
$('#paypalButton').fadeOut();
right below $(document).ready(function() {
and tell me when you did that
and upload the site
and lemme see if it work
 
It is the testing version
 
9:29 AM
ok cool
So
Do what I said about the code
and tell me when you're done]
 
I already did it on that page
[Error] TypeError: undefined is not a function (evaluating '$('#paypalButton').prop("disabled", true)')
global code (enterudidtesting.html, line 33)
 
wtffff
ok..
Take that off
and go back to what it originally was
and take out this line of your source
<link rel="stylesheet" href="more/more.css">
Line 21
and refresh
Are you sure you're updating your website? Cause nothing is changing on my end
 
Wait a second I will turn cloud flare on development mode
 
okk tyty
 
Using the original code and removed the stylesheet
 
9:34 AM
Good stuff
 
I don't see the javascript I sent you right about the </body> tag?
not </head>
move it down to above </body>
 
inside the body tag?
 
like
right below the google analytics
but inside the body tag
 
which version of the code?
 
9:36 AM
the one you have right now on your website
Before i told you to change it
ok good shit
style="display:none;" to the form
Now add back in
Bueno?
 
It half works, pressing enter when the button is hidden still submits the form
 
How sure are you about this?
I tried it on chrome and firefox
What browser are you using?
 
safari
 
oh
let me see
doesn't work for IE either
let me see
 
I changed the link back to: ipwnstore.me/enterudid.html
 
9:43 AM
ok cool
Ok
change the disabled
to disabled="disabled"
 
where?
 
<input type="image" style="display:none;" src="https://www.paypalobjects.com/en_AU/i/btn/btn_buynow_LG.gif" name="submit" id="paypalButton" alt="PayPal — The safer, easier way to pay online." disabled="">
make the disabled
be disabled="disabled"
 
lol turn on cloudfare develeopment please
<input name="submit" id="paypalButton" style="display: none;" type="image" alt="PayPal — The safer, easier way to pay online." src="https://www.paypalobjects.com/en_AU/i/btn/btn_buynow_LG.gif">
It's not even there now lol
 
already on
 
9:50 AM
you sure you fixed the disbled?
 
yep
I can confirm it works in Chrome
 
Correct
Is it still screwing up in IE?
safarI***
 
yeah
 
One moment
Ok
let me put the code on pastebin
<script>
$(window).keydown(function(event){
if(event.keyCode == 13) {
event.preventDefault();
if($('#field').val().length == 40){
$( "#paypalForm" ).submit();
}
}
});
$(document).ready(function() {
$("#field").keyup(function() {
if ($('#field').val().length == 40) {
$('#paypalButton').fadeIn();
} else {
$('#paypalButton').fadeOut();

}
});
});
</script>
Fuck it lol
Okay
Replace your javascript code with that
Here
Replace the form and the javascript with that
and retry
 
replacing now
 
10:03 AM
ook
 
i think it works :)
 
Woo
god bless
So if you're happy with it
if you could mark my answer as correct that'd be great!
 
Cool, have you updated the answer?
 
I have
and Don't hesitate to message me if you need anymore help with anything
 
Alright thanks so much
 
10:08 AM
Of course :)
 

last day (14 days later) »