Go Back   CodingForums.com > :: Client side development > JavaScript programming > Ajax and Design

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 02-21-2008, 03:48 PM   PM User | #1
mdj101
New Coder

 
Join Date: Feb 2008
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
mdj101 is an unknown quantity at this point
Form Validation wont work in ajax window.

Hi All,

Im new to all this as you are probably aware!

I've come accross a stumbling block.

On the following page if you try and submit the form with empty fields you get a javascript alert.

http://www.fireworkscrazy.co.uk/stor...add.asp?id=166

However, the same form is pulled into this page,

http://www.fireworkscrazy.co.uk/stor...exd.asp?id=166

cliick on the "add your own review" link at the bottom of the review section. When the page loads, if you try and submit the form empty you don't get the javascript alert.

Can someone please explain why and if it can be resolved?
mdj101 is offline   Reply With Quote
Old 02-22-2008, 02:16 PM   PM User | #2
chud_wallice
New Coder

 
Join Date: Mar 2005
Posts: 50
Thanks: 0
Thanked 2 Times in 2 Posts
chud_wallice is an unknown quantity at this point
Have you tried including the validation script in the main page?

I wouldn't call the form into the page using ajax.
I'd put the form directly into the page and hide it onload.

Though you may want to add the review, and update the page on submission using ajax...
__________________
see the munki click- was that so random?
chud_wallice is offline   Reply With Quote
Old 02-22-2008, 02:26 PM   PM User | #3
mdj101
New Coder

 
Join Date: Feb 2008
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
mdj101 is an unknown quantity at this point
Hi Chud,

Thanks for your reply.

The form that is pulled in is part of an asp script, not just an html form and the page it pulls in does all the asp work aswell. I'm really trying to make the cart nicer to use etc, if i was re-inventing things, starting the site from scratch then i believe that alot of the suggestions that have been made would work great and I would have a lot more flexibility, im not a coding guru by any means and its where i fall short of being able to sort these little problems out.
mdj101 is offline   Reply With Quote
Old 02-22-2008, 02:28 PM   PM User | #4
mdj101
New Coder

 
Join Date: Feb 2008
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
mdj101 is an unknown quantity at this point
I could like you say include the validation page in the main page, i will try that!
mdj101 is offline   Reply With Quote
Old 02-23-2008, 12:31 PM   PM User | #5
chud_wallice
New Coder

 
Join Date: Mar 2005
Posts: 50
Thanks: 0
Thanked 2 Times in 2 Posts
chud_wallice is an unknown quantity at this point
so does it work now when you put the validation script on the main page?
__________________
see the munki click- was that so random?
chud_wallice is offline   Reply With Quote
Old 02-23-2008, 02:05 PM   PM User | #6
mdj101
New Coder

 
Join Date: Feb 2008
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
mdj101 is an unknown quantity at this point
Had a couple of server issues so havent had a chance to try it out yet!
mdj101 is offline   Reply With Quote
Old 02-24-2008, 04:04 AM   PM User | #7
mdj101
New Coder

 
Join Date: Feb 2008
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
mdj101 is an unknown quantity at this point
Hi Chud,

Just had a chance to play around with this and the javascript works perfectly when its embeded in the original page! Thanks for the suggestion.
mdj101 is offline   Reply With Quote
Old 02-24-2008, 04:06 AM   PM User | #8
mdj101
New Coder

 
Join Date: Feb 2008
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
mdj101 is an unknown quantity at this point
Im now going to attempt a couple of other pages. I'm sure I will be back!
__________________
Regards,

Mark
Fireworks
mdj101 is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

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

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

Forum Jump


All times are GMT +1. The time now is 09:12 PM.


Advertisement
Log in to turn off these ads.