|
I'm having trouble amending this javascript form submission to also allow the "Enter" key to submit the form. I'm not that experienced with javascript, so my googling has not been resulting in any successes at inserting the additional elements. my form currently checks a text area entry against a list of promotional codes before passing the user along to the next page, what I need it to do is to accept both pressing the 'go' button as well as hitting enter to submit the promotional code, so if anyone could explain to me how to do that I'd really appreciate it. My form: code:
code:
|
# ¿ Jul 7, 2009 18:28 |
|
|
# ¿ Apr 29, 2024 05:05 |
|
Thanks for that tutorial link - didn't actually get my problem solved but having looked over that site some more, I'm learning more about JS now than I...uh, really wanted to know. But I did eventually get my script tweaked using googled results that plugged into my existing form validator... Here's what did the trick: code:
|
# ¿ Jul 7, 2009 20:51 |
|
Avenging Dentist posted:A-are you seriously doing validation on the client side? Tell me about it. I wanted to do serverside validation with PHP but the location of the program is outside our boundaries, and the clients (and my bosses) were happy with the total lack of security. I let them know that this was not the real way to do this, but they didn't care. Which is why I ended up hacking up some JS to function here. The promo codes are freebie giveaways anyway, that are all virtually the same, but we wanted the illusion that they're original. Fundamentally security wasn't that high a priority with the sponsors, they were more interested that the users are passed through to the part where they spend money. Kilson posted:Shouldn't it work just to make your input button type="submit"? You can't do a satisfactory image replacement of the submit button (or at least not have it work in IE 6, which we stupidly continue to support - would typically be done with CSS v2) with input type="submit", it has to be input type="button" to use an image as the button. Which generated all this additional nonsense anyway.
|
# ¿ Jul 8, 2009 18:22 |
|
I have a question about setting cookies - does anyone know if it's even possible to cookie a user so that he's rendered a different domain's site in a no-mobile (desktop) state? Like, for instance - set the cookie on page load on a http://adserver.company.com location that links users to http://www.company.com but tell them to only be served the desktop site when they get there, regardless of device? (our mobile team shat the bed and forgot a pretty major feature in their product, so in the rush to not play the blame game they're dumping all the work on my group who doesn't normally write cookies.) I can't seem to find googled consensus that you can go cross-domain like this reliably, and being pretty unfamiliar with cookies I'm not even sure where to start attempting and I'd rather skip the fun of trying if it's not even doable. *I am not 100% sure that http://adserver.company.com is a fully a 'subdomain' of http://www.company.com, so that further muddies my searching.* This is what I'm using and it's working on my http://adserver.company.com pages, showing up as set with the correct value and expiry date, but as soon as the user moves on to the http://www.company.com pages, it's lost (and they get the broken mobile site.) code:
|
# ¿ May 6, 2014 01:31 |
|
fletcher posted:adserver.company.com and https://www.company.com are both subdomains of company.com so you don't have to worry about cross-domain anything (which is good because cross-domain cookies do no exist). Thanks... read through that and it made sense but I'm still not having any luck making the domain definition work correctly, I still haven't ruled out the fact that our redirect process is dropping out the cookie even if I DO have it set correctly here. F'n mobile team.
|
# ¿ May 6, 2014 20:09 |