Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Adobe DW CS3 with ASP, Coldfusion, and PHP Training book - problem.

Guest
Aug 12, 2008 Aug 12, 2008
Hi

I have been creating a site and using the DW CS3 'Training from the Source' book by Jeffrey Bardzell and Bob Flynn as the tutorial text.

Basically - I have an .asp form that collects data into fields, which are validated using the DW validate form funstions, then passes the data to another .asp page that emails the data to me.

All works well for me and for a lot of people I have used to test the site....

BUT

I am getting some people whose data is obviously NOT being captured or passed - as teh Emails are blank. I can't ask them what browsers they are using - as their Email address should be in the Data !!

I did try the form with the Javascript Disabled in my browser - and the validation then failed to work - but the data still did get sent.

1. If Javascript is disabled - how can I get the validation to work?

2. Is there any other reason that my data may be getting lost

Thanks in Advance

Phil
TOPICS
Server side applications
543
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Aug 13, 2008 Aug 13, 2008
If I have got it right, since you are using asp, before sending the data you may also write a code to validate data using ASP script. This ensures validation of each fields even if Javascript is disabled.

Something like..

Email=request.form("email")
Name=request.form("email")

If Email<>"" and Name<>"' then
server.transfer("pagename.asp")
End If
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Aug 13, 2008 Aug 13, 2008
Thanks WebPro

I do have validation on the form - as created using the DW CS3 Validate Form option....


<form action="CA_Process_Survey.asp" method="post" name="form1" onSubmit="MM_validateForm('CA_Name','','R','CA_Email_Address','','RisEmail','CA_Expected_Price1','','NisNum','CA_Expected_Price2','','NisNum','CA_Expected_Price3','','NisNum','CA_Expected_Price4','','NisNum');return document.MM_returnValue">


...but I've since found that this doesn't work if some of the script options are disabled in the browser.


Surely if DW is creating this then it should aways work ?
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Aug 13, 2008 Aug 13, 2008
PhilAJ,

quote:

Surely if DW is creating this then it should aways work ?


It would be nice, wouldn't it? ;-)

There are two basic types of validation - client-side and server-side.

Client-side validation uses JavaScript, in this case the code that DW generates, but you are dependent on the user's browser settings. It happens on the user's machine before anything is sent back across the Internet to your web server. If they want to turn off JS, they can.

Server-side validation takes place on the server with the data sent from the user. webpro2k has provided you with a nice bit of code to test whether those fields come in blank. If they do, you can decide what to do with the user's interaction. Instead of the Thank You page, or wherever you may have sent them after a successful submission, you could send them back to the form indicating the fields they neglected to fill out and pre-populating those they already filled out with the data from the first submission.

Best practice is to do both client-side (in theory it reduces user frustration if done right.) and server side (to ensure clean data). It takes a little extra work. You know your audience and your needs, so you can do the cost/benefit analysis.

Regards,

Bob
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Aug 13, 2008 Aug 13, 2008
Thanks Bob - I'll give that a go. I'm a bit of a novice when it comes to scripting - hence using DW and its inbuilt functions. I'll try to work it out what i need to code.

Phil
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Aug 13, 2008 Aug 13, 2008
I have had exactly the same problem. I mentioned this to one of Adobe's freelancers and although he hasn't seen the code to my problem, his reaction was that I might have a cursor in the wrong place!!

I have no idea what that means, but hopefully somebody here might do because I have a hell of a time trying to get it right.

I basically have to resort to posting directly to the db and then the thankyou page sends an email that pulls the very last entry out of the db.

It's not ideal by any stretch of the imagination, but it works.

Mat
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Aug 13, 2008 Aug 13, 2008
LATEST
Hi Mathew

I've not got as far as putting the data to a database yet - I ws just passing it to a page t email me - while I got to the next step of setting up SQL.

Phil
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines