reg expression or javascript?

User 2199435 Photo


Registered User
20 posts

Hi,
I am not a programmer by any means and I just need some direction.

In my form I have for example 5 pictures and the people need to rank them by:
Their favorite
Their Least favorite
and then rank the rest 2,3,4

Example of what I have so far is here: http://www.depthwork.com/lpa/lpa.html

My problem is that there is nothing stopping them from making the mistake of choosing the same picture twice or more.

Maybe I have set this up all wrong to begin with...and if so...does anyone have a better way with how the software exists now.

If not....can I make it show an error message that they already selected that one? Can I use the reg exp function in the program to do that or have javascript do it??? If so any help with what function I would use.

I would hate to spend hours learning one scripting language only to find out it wont work and then have to learn another one....arg.

Now...if someone who knows they could write this in 5 minutes and would like to do so...that would be WONDERUL! :)

Any help would be greatly appreciated.

Thanks in advance,
Marilyn
User 464893 Photo


Ambassador
1,611 posts

That's a problem with the last two sections. Firstly you cannot use Radio buttons as as you can only make one choice. You could use check boxes and on submission check the entered data of those entries sending a person back if wrong. I may be wrong but I do not think a reg.exp would handle that.

The easiest will be for users to fill it in correctly but looking at the form I guess that unlikely. I see the solution as using php to do it.
I guess I repeat myself here but with that a check on those last two tests can be made. It would mean that a person would have to fill the entire form again as it cannot be re populated. If you could wait a bit I could help. I have committed to someone else at the moment. You could contact someone from Codeworks if you are desperate. If not contact me at http://inkmon.org/contact I do not expect payment but I am helping a young guy with his site at the moment. What you would have to do is first contact me for my email and send the fb file & csv file so I see the structure.
The Guy from OZ


User 464893 Photo


Ambassador
1,611 posts

Looking a bit more into it is a bit more complicated I looked at the first couple of choices. Or is that a cognitive test to check understanding of the questions?
The Guy from OZ


User 2199435 Photo


Registered User
20 posts

Hi,
Thank you for the response.

There is no right or wrong way to answer...it is like the Rorschoch (ink blots). They just rank them in order by what they like best to least 1-5 ....and then depending on which card is in which spot makes the result.

The way I have it now works as far as giving me their answers... I don't believe the people would pick the same one twice on purpose (ya never know lol) but I actually did it by mistake when I was entering in test data.


Thanks,
Marilyn
User 187934 Photo


Senior Advisor
20,193 posts
Online Now

Why not put each pictures radio buttons that are down a column all in the same group so it can only be picked once.
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com
User 2073552 Photo


Registered User
1,625 posts

Why not have a drop down box?

And have a little side note that says only select one of each.
"An Apple doth not fall far from its tree, yet an orange does."

https://lbwebsitedesign.com - Responsive Web Design & Web Hosting Services.
http://helpsite.sirage.com - HTML5, CSS3 and CC Help Video Blog.
User 2199435 Photo


Registered User
20 posts

Hi,
Sorry....not sure what you mean Eric.



User 2199435 Photo


Registered User
20 posts

Hi,
If I use a dropdown....how will I know what order they put each picture in? If I do what I did already and make it a dropdown..it still wouldnt stop the person from picking the same thing twice, I think.

User 187934 Photo


Senior Advisor
20,193 posts
Online Now

Never mind I took a closer look and you can't assign the same group to individual radio buttons.:/
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com
User 464893 Photo


Ambassador
1,611 posts

The simple way as I see it is to use check boxes for choices when more than one is required. If someone chooses the same one twice I guess that is an in indication of how they understood the question. Otherwise it is a course of redirecting to some sorting routine. The poor old Form Builder sure has to be pushed to the limit
Radio Buttons = 1 only of many
Check Boxes = 1 to n of n
The Guy from OZ



Have something to add? We’d love to hear it!
You must have an account to participate. Please Sign In Here, then join the conversation.