Hmm, I'm not sure. It seems like everything is working the way it's supposed to now, as far as my script, except that it's not.... I'm still looking. We'll figure it out, this is all part of testing.
Just until we figure out what's causing the problem, let's change the ValidateForm() to stop form submission so we can see all the HTML changes that occur.
At the very bottom of ValidateForm(), you'll see a line that says "return true;". Let's change that to "return false;" temporarily. I'm talking about in the valid.js file.
Use this file: DISREGARD, SEE BELOW
Last edited by jamesbcox1980; 11-12-2009 at 12:09 PM.
I'm home now and transferred over the new js file you sent over. I noticed on that file the "return is true" on the last line. Do you want me to change it to "return false"?
No, that fixed the problem, but fixing that shows there's one last (hopefully) problem to deal with. Since we're not adding them manually, there are no pre-existing inputs to look at, so we need to adjust the PPopSort array to handle that.
Hopefully, one last upload:
Last edited by jamesbcox1980; 11-12-2009 at 12:34 PM.
check my post again, I just edited and add the new file (where I said "Hopefully, one last upload"). It was actually the same problem we had the first time around, and I added the ternary operator... I used the original script :P
Last edited by jamesbcox1980; 11-12-2009 at 12:40 PM.
I uploaded the valid.js script from the (hopefully) post. I checked it and now that "Add object or person" keeps showing up. What can I do to get rid of this?
I emailed a few other developers and one of them got back to me and suggested the following:
Code:
You might try something like this in HTML:
<input id=”on0” type="hidden" name="on0" value="Photo manipulation">
<input id=”os0” type="hidden" name="os0" value="Whatever addons the customer selects">
With this corresponding javascript:
var on0 = document.getElementById('on0');
on0.setAttribute("on0", "My Desired value”);
No, that's essentially what I was doing with the script. The script is fine now and is working. The problem is it's not getting run because of some other error on the page.
When I finish filling out the form, and I run ValidateForm() using the FireBug watch script, it adds the options perfectly.
Yeah, it's only adding one add-on. I just realized that the checkboxes at the bottom may be causing the problem. When writing this, I wasn't even thinking of them. I'm working on it. I should be able to get this working fully using firebug before I get back to you
Bookmarks