Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 8 of 8
  1. #1
    New Coder
    Join Date
    Feb 2008
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts

    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?

  • #2
    New Coder
    Join Date
    Mar 2005
    Posts
    50
    Thanks
    0
    Thanked 2 Times in 2 Posts
    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?

  • #3
    New Coder
    Join Date
    Feb 2008
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.

  • #4
    New Coder
    Join Date
    Feb 2008
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I could like you say include the validation page in the main page, i will try that!

  • #5
    New Coder
    Join Date
    Mar 2005
    Posts
    50
    Thanks
    0
    Thanked 2 Times in 2 Posts
    so does it work now when you put the validation script on the main page?
    see the munki click- was that so random?

  • #6
    New Coder
    Join Date
    Feb 2008
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Had a couple of server issues so havent had a chance to try it out yet!

  • #7
    New Coder
    Join Date
    Feb 2008
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.

  • #8
    New Coder
    Join Date
    Feb 2008
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Im now going to attempt a couple of other pages. I'm sure I will be back!
    Regards,

    Mark
    Fireworks


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •