HighDots Forums  

Dropdown List Validation on PayPal Forms

JavaScript discussion (multi-lingual) JavaScript discussion (alt.comp.lang.javascript)


Discuss Dropdown List Validation on PayPal Forms in the JavaScript discussion (multi-lingual) forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Tony Carnell
 
Posts: n/a

Default Dropdown List Validation on PayPal Forms - 09-18-2005 , 02:32 PM






Hi all,

I've got a PayPal form on a page I'm designing, where a user can select
from two dropdown list boxes before clicking the usual PayPal 'Buy Now'
button.
The options in the dropdown boxes are then passed to PayPal (I'm sure
you all know how it works!)

I want to perform a very simple form validation routine on the two
dropdown lists BEFORE sending the user off to PayPal to ensure they've
actually selected something from them.
I've made the top item in the lists say 'SELECT' by default and want to
check to see if either boxes' selected option is equal to this. If so I
want to pop up the usual box asking them to make a selection.
I'm sure you all know what I'm trying to achieve!

The html for the Form itself is:
<form action="https://www.paypal.com/cgi-bin/webscr" method="post"
name="Order" target="paypal" id="Order" title="Order">

It's the standard code that PayPal provide for their members.

The thing is I've tried inserting an OnSubmit Javascript call to this
line so that the Javascript is run, but this doesn't seem to happen. All
that does happen is that the standard PayPal shopping cart screen pops
up with my item added - with both options blank!
Is it because the form's 'action' is to go to an external site that's
the reason the Javascript call doesn't seem to be working? Or is there
something I'm missing?

Sorry, I'm a bit of a novice! ;-)

Thanks in advance for any help given.

Tony.

Reply With Quote
  #2  
Old   
Jasen Betts
 
Posts: n/a

Default Re: Dropdown List Validation on PayPal Forms - 10-16-2005 , 03:47 AM






On 2005-09-18, Tony Carnell <tony (AT) fluvius (DOT) co.uk> wrote:
Quote:
Hi all,

I've got a PayPal form on a page I'm designing, where a user can select
from two dropdown list boxes before clicking the usual PayPal 'Buy Now'
button.
The options in the dropdown boxes are then passed to PayPal (I'm sure
you all know how it works!)

I want to perform a very simple form validation routine on the two
dropdown lists BEFORE sending the user off to PayPal to ensure they've
actually selected something from them.
I've made the top item in the lists say 'SELECT' by default and want to
check to see if either boxes' selected option is equal to this. If so I
want to pop up the usual box asking them to make a selection.
I'm sure you all know what I'm trying to achieve!

The html for the Form itself is:
form action="https://www.paypal.com/cgi-bin/webscr" method="post"
name="Order" target="paypal" id="Order" title="Order"
where's your onsubmit="<javascript>"

Quote:
It's the standard code that PayPal provide for their members.

The thing is I've tried inserting an OnSubmit Javascript call to this
onsubmit like all HTML tags should be lower case.

Quote:
line so that the Javascript is run, but this doesn't seem to happen. All
that does happen is that the standard PayPal shopping cart screen pops
up with my item added - with both options blank!
Is it because the form's 'action' is to go to an external site that's
the reason the Javascript call doesn't seem to be working? Or is there
something I'm missing?
are you certain your validation code works? unless it returns false
the form will submit. (if it exits with an error the form will submit)

try

onsubmit="return false"

and see if that blocks submitting, work your way up from there.

Bye.
Jasen


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.