SolvedPrivate

Change values of dropdown without comprmising fucntionality

Posted on 2015-02-06
10
10 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
  • 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
 
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
What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

 
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 500 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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

This article discusses the difference between strict equality operator and equality operator in JavaScript. The Need: Because JavaScript performs an implicit type conversion when performing comparisons, we have to take this into account when wri…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
Any person in technology especially those working for big companies should at least know about the basics of web accessibility. Believe it or not there are even laws in place that require businesses to provide such means for the disabled and aging p…

705 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now