?
SolvedPrivate

Change values of dropdown without comprmising fucntionality

Posted on 2015-02-06
10
Medium Priority
?
20 Views
Last Modified: 2016-05-08
This is a follow-up to the following question:
http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28525464.html

I got the radio buttons to convert to a dropdown, but the problem is that instead of displaying for our staff the backing that was chosen, it displays 0, 1, 3, or 4. If I alter those numbers, I lose functionality.

THE PAGE:
http://www.qualitywovenlabels.com/auto-quote-woven.htm
THE FUNCTIONALITY:
http://www.qualitywovenlabels.com/js/autoCode.js
0
Comment
Question by:underrugswept
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 4
10 Comments
 
LVL 44

Expert Comment

by:Rainer Jeschor
ID: 40593742
Hi,
could you please elaborate on
displaying for our staff
Where is your staff seeing this?
From the Javascript I can see, that the select box should set the hidden fields named product_id and product_name to the corresponding values.
Thanks.
Rainer
0
 
LVL 1

Author Comment

by:underrugswept
ID: 40593758
OK, that's interesting. Apparently it's working on that site, but not on this:
http://customwovenlabels.com/quote-woven.html
http://customwovenlabels.com/js/autoCode.js
(same setup)

What am I doing on Quality Woven Labels that's making it work that I'm not doing on this one?


(In light of this. I don't think elaborating on "displaying for our staff" is necessary, but let me know if it turns out to be)
0
 
LVL 44

Expert Comment

by:Rainer Jeschor
ID: 40593797
Hi,
the first but very important thing is that the html page is missing the script reference to jQuery.
Could you please add this first?
There are a bunch of scripting errors due to the missing reference.
HTH
Rainer
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 1

Author Comment

by:underrugswept
ID: 40593811
Nothing in quote-woven.html is using jQuery, and that's why I left it out. And when I put it in, it causes conflicts and makes my price calculations stop working. But I put it in. You can refresh the page.
0
 
LVL 44

Expert Comment

by:Rainer Jeschor
ID: 40593833
Thanks.
You referenced bootstrap which requires jQuery.
As well as superfish also complains about missing jQuery.
Could you please put the jquery references on top  before loading any other script like superfish.js?
Thanks.
Error loading scripts
0
 
LVL 1

Author Comment

by:underrugswept
ID: 40593855
Done. Sorry for the headache.
0
 
LVL 44

Accepted Solution

by:
Rainer Jeschor earned 2000 total points
ID: 40593987
Hi,
thanks - and nope, no headache - just web dev as usual :-)

It should work now as I could get the correct values from the hidden form elements like product_id and product_name.
But there are still a lot of Javascript errors as e.g. the emptyCart function tries to set
$('patches_percentage_radio_2').checked = true;

Open in new window

but this field does not exist on the page.
As it seems that you use the autoCode.js on multiple but different pages, perhaps it may help to split this file into two files.
One file containing all the patch array information which can be included in all html files as well as a dedicated JS file with the page related logic.
HTH
Rainer
0
 
LVL 1

Author Comment

by:underrugswept
ID: 40594012
Yeah, I know the whole thing is an utter and complete mess. In the near future we're going to get it more updated and modernized.


I'm trying to decipher what your solution actually is. Am I supposed to go into autoCode.js and un-comment-out that line of code?
0

Featured Post

Will your db performance match your db growth?

In Percona’s white paper “Performance at Scale: Keeping Your Database on Its Toes,” we take a high-level approach to what you need to think about when planning for database scalability.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When crafting your “Why Us” page, there are a plethora of pitfalls to avoid. Follow these five tips, and you’ll be well on your way to creating an effective page.
When it comes to security, close monitoring is a must. According to WhiteHat Security annual report, a substantial number of all web applications are vulnerable always. Monitis offers a new product - fully-featured Website security monitoring and pr…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
Suggested Courses

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question