SolvedPrivate

Change values of dropdown without comprmising fucntionality

Posted on 2015-02-06
10
15 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
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

Suggested Solutions

Get to know the ins and outs of building a web-based ERP system for your enterprise. Development timeline, technology, and costs outlined.
There’s a good reason for why it’s called a homepage – it closely resembles that of a physical house and the only real difference is that it’s online. Your website’s homepage is where people come to visit you. It’s the family room of your website wh…
Viewers will get an overview of the benefits and risks of using Bitcoin to accept payments. What Bitcoin is: Legality: Risks: Benefits: Which businesses are best suited?: Other things you should know: How to get started:
The viewer will learn how to dynamically set the form action using jQuery.

803 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