close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Problem inserting latitude longitude data

Thread began 2/25/2010 7:14 am by roger391472 | Last modified 3/03/2010 4:26 pm by Eric Mittman | 3789 views | 19 replies |

roger391472

Problem inserting latitude longitude data

Hello,

I've started a new thread because once again this seems to be an unrelated problem. I've finally got the forms figured out with the exception of problems inserting data into 3 fields, they are one for latitude, one for longitude and one that is a decimal and I can't get them to insert correctly no matter what I try.

I've got to get my business going which means going live by March 1st so I really need your help. I would like to do this by hand coding if at all possible since this page has a ton of checkbox fields that have to be renamed so it takes a long time to rebuild this page after CSS FB renames the fields, I've already rebuilt it a number of times. By the way, just a second comment, I'm putting the form into a CSS content wrapper that is within a page wrapper and if I reedit anything in the CSS FB it eliminates the form wrapper and covers up the rest of the page content when it rebuilds the form so if I make any changes to the form I have to completely start over.

The Google maps documentation recommends the columns to be "float 10,6" so that's what I started with. The form field was set to "numeric" originally. I've now even tried the columns as VARCHAR and the field type set to "text" and even that doesn't work if you try to input the decimal point or a minus sign, the complete form insert fails. If you take out the decimal and minus sign then the form will insert the data but of course that's not an option. I've also tried "integer" and "text" column settings and nothing has worked.

I've attached the code and would greatly appreciate your help.

Thanks,

Attached Files
track_sanction_code.zip
Sign in to reply to this post

roger391472

Update

OK, it's the period that's the problem, it will accept the minus sign. The funny thing is that it will accept the correct data in the "city" field on the form.

I saw the thread about "not accepting periods and commas" below this thread so I tried adding the validation server behavior that was mentioned there with it set to "alphanumeric" and added the "." as allowed but that didn't work either.

Sign in to reply to this post

Eric Mittman

Is it just the server side validation that is failing for you? Looking at what you have specified for the various server validations I can see one that looks to be configured to allow for a comma (,) and a decimal (.) but the others for the lat and long do not look to be configured like this.

Sign in to reply to this post

roger391472

Hi Eric,

No, the latitude, longitude and track_size aren't configured that way now. I tried to add validation to them after I sent the code attachment but it didn't work. I tried it by adding the "." as an allowed character with the setting of alphanumeric but it didn't help.

And I guess the problem is not so much a validation problem as it is a data insert problem. It just will not insert a "." into the column at all. It will insert the "minus sign" however. I thought it was strange that it won't even accept a "." when the column is set to VARCHAR.

Maybe I didn't get the validation applied correctly when I tried it????

Let me know if you need the database schema or anything sent if that would help.

thanks,

Roger

Sign in to reply to this post

roger391472

new information

Hi Eric,

I was mistaken, there was validation on the latitude, longitude and track size fields, I'm thinking it was probably the same one that you mentioned in the reply above because it does have the (,) and (.) in it. Here's the code that was in the latitude field:

<?php
if (ValidatedField('tracksanctionregistration','tracksanctionregistration')) {
if ((strpos((",".ValidatedField("tracksanctionregistration","tracksanctionregistration").","), "," . "14" . ",") !== false || "14" == "")) {
if (!(false)) {
?>
<span class="serverInvalidState" id="Registration_group_ServerError_22"> </span>
<?php //WAFV_Conditional track_sanction_registration.php tracksanctionregistration(14:)
}
}
}?>

Now here's the really strange part, I removed the validation from all three of the fields. Those field types are set to Text. The MySQL column is set to VARCHAR and it still won't accept the "." The minus sign goes in fine.

It seems to me that those settings should allow anything to be entered but it's just not happening. I removed the validations by using the "-" in the server behavior tab, is there anything else I should have done?

Thanks,

Roger

Sign in to reply to this post

roger391472

Solved

Hi Eric,

I finally figured it out so I'll post again in case it might help anyone in the future, I use these threads for troubleshooting so hopefully this will help somebody someday.

The problem was coming from when CSS FB named the fields using the field label. I had a slash in the "Track Size" label as in "1/4 mile" and in the latitude line I had a latitude example of something like -32.998657 so it included a "decimal point". The only thing I can figure about the longitude line was that the label was in two sentences and it eliminated the period at the end of the first sentence when it named the field. When the fields were named by CSS FB it eliminated the slash and the periods and that was causing a problem somewhere in the code although I'm not quite sure where.

The fix was to rename those fields which wasn't a problem at all since they weren't validated fields. I then went back into the "insert record" behavior and reset the fields to the new field name and that did it.

So that ones fixed but don't go too far from your computer...I'm working on a "check user" validation for the e-mail and password fields and so far It's not working so I may be back. LOL

I'm trying to follow this link to do it: showthread.php?t=5084&highlight=check+user&page=2

Thanks for the help.

Sign in to reply to this post

Eric Mittman

What exactly are you trying to implement for the email password page to check the user? Please describe how you would like it to work and how the information you will be using relates to the users table.

Sign in to reply to this post

roger391472

Hi Eric,

This is a registration form so I would like it to check to be sure the same e-mail address isn't already in the database. I would like to do this for the password column too.

If the email address or password is already in the database then I would like an error message to display, something like "password is already in use, please enter a different password" and the same thing for the e-mail address.

I saw in the thread that I mentioned where Jason said you could apply two validations on the same field and I've been trying that but haven't been able to get it to work yet.

Here's what I was doing:
I opened the current WA Server Validations.
Used my page submission as the trigger
Used the number setting
set minimum to -1
set maximum to 0
Server validation - I'm not clear which I should choose here, the folder with my page name or the WA Validated folder.

When i do it that way the "insert" fails and the page reloads without the data that was entered.

By the way, I did follow the instructions in that thread and made two additional recordsets, one for the e-mail and one for the password and I'm not sure if I still need those or not when doing it this way.

Thank you so much for your help, I'm falling way behind on my March 1st launch date so this is really helping me out.

Roger

Sign in to reply to this post

Eric Mittman

In DW and Security Assist the method is to have an extra recordset that looks for any records where the email matches the one entered by the user. If any matches are found, meaning the recordset is not empty, then the user already exists and that email address should not be allowed.

That is the concept in general but there is a problem with letting the user know if a password has been used. This is a security risk as you can verify exact password matches in your users table. It should not matter if two or more users have the same password so long as they don't have the same email or login it will not affect anything.

So the check should only be done with the email. Your recordset should select from your user table and filter on the posted email address. If there are any rows in the rs then the insert should not occur and you should display an error to the user. In your check for the rows of the recordset you would have a header call that will redirect the user to this same page with a URL parameter to indicate that the email address was a duplicate.

Please post back with any further questions that you have about this so we can help you get it worked out.

Sign in to reply to this post

roger391472

Hi Eric,

Hadn't thought about the password thing, I'll take out that recordset.

At this point the e-mail recordset is on the page and I've got it filtered through the e-mail column, I forgot to mention that in the last reply but it was already on the page when I tried setting the validation before.

I guess the place to start with questions though is whether or not I was doing the correct steps. The listing in my previous reply was the way I was trying it but something was going wrong.

You mentioned a "header call" and I'm not familiar with that term so I'll study up on it but any clarification you can give would help.

According to the sequence that i listed in my last reply was that the correct method for doing it?

Sorry to be so much trouble. This site was a pretty aggressive undertaking for my first dynamic site and only the 4th site I've ever done but my job went away and starting this site was what I had to do. Man, what was I thinking? LOL

Sign in to reply to this post
loading

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...