469,642 Members | 1,221 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,642 developers. It's quick & easy.

Firefox setting hidden input error.

Here is my code:

...
Setting hidden input to: <dsp:valueof param="tabname"/>
<input name="tabname" type="hidden" value='<dsp:valueof param="tabname"/>'/>
</dsp:form>

hidden input set to:<script language="JavaScript"> document.write(document.getElementById("tab_switch RefreshForm").elements.tabname.value);</script><BR/>

Now when I'm in IE, everything works fine and the output is as follows:

Setting hidden input to: moreDetails
hidden input set to:moreDetails

However in firefoc the output is:

Setting hidden input to: moreDetails
hidden input set to:features

Huh? "features" is another valid entry for this field, but I feel that this code is pretty straight forward. is the value attribute for hidden fields broken for firefox?!??
Feb 29 '08 #1
2 2404
hsriat
1,654 Expert 1GB
Huh? "features" is another valid entry for this field, but I feel that this code is pretty straight forward. is the value attribute for hidden fields broken for firefox?!??
How could Firefox know that there's some other valid entry too. There must something wrong out of this snippet. You may post more code, so that its easy to tack the problem.

* Include your code in CODE tags.
Feb 29 '08 #2
How could Firefox know that there's some other valid entry too. There must something wrong out of this snippet. You may post more code, so that its easy to tack the problem.

* Include your code in CODE tags.
Alright, here's some more information. This is the file "tab_switchRefreshForm.jspf":

Expand|Select|Wrap|Line Numbers
  1. <dsp:form formid="tab_switchRefreshForm" id="tab_switchRefreshForm" method="post"
  2.           action="${originatingRequest.contextPath}/browse/gadgets/moreDetails_display.jsp">
  3.   <input name="product" type="hidden" value='<dsp:valueof param="product"/>'/>
  4.   <input name="productId" type="hidden" value='<dsp:valueof param="product.repositoryId"/>'/>
  5.   <input name="sku" type="hidden" value='<dsp:valueof param="sku"/>'/>
  6.   Setting hidden input to: <dsp:valueof param="tabname"/>
  7.   <input name="tabname" type="hidden" value='<dsp:valueof param="tabname"/>' />
  8. </dsp:form>
  9.  
  10. hidden input set to:<script language="JavaScript"> document.write(document.getElementById("tab_switchRefreshForm").elements.tabname.value);</
  11. script><BR/>
Then there is a file which calls it, which I'm showing a simplified version of:

Expand|Select|Wrap|Line Numbers
  1. <div id="moreDetailsTabs">
  2.   <%@include file="tab_switchRefreshForm.jspf"%>
  3.   ...
  4. <dsp:a href="javascript:void(0)" onclick="productTabs.clickTab('features')">
  5. </div>
  6.   ...
  7. <dsp:a href="javascript:void(0)" onclick="productTabs.clickTab('moreDetails')">
  8.   ...
  9. </div>
And finally, the javascript, in its own file (provided using dojo)

Expand|Select|Wrap|Line Numbers
  1. productTabs={
  2.  
  3.     //called when a user clicks a tab
  4.     clickTab: function(tabname) {
  5.     var form = dojo.byId("tab_switchRefreshForm");
  6.     var currentTab = form.elements.tabname.value;
  7.  
  8.  
  9.     //If the same tab was clicked as is already showing, do nothing
  10.     if(currentTab === tabname) {
  11.         return;
  12.     }
  13.  
  14.     //set the new selected tab in the refresh form and submit it
  15.  
  16.     form.elements.tabname.value = tabname;
  17.     var thisInstance = productTabs;
  18.  
  19.     thisInstance.submitRefreshForm();
  20.     },
  21.  
  22.     submitRefreshForm: function()
  23.     {
  24.       dojo.io.bind({
  25.       load: function(type, data,evt){
  26.         var divProductTabs = dojo.byId("moreDetailsTabs");
  27.         divProductTabs.innerHTML = data;
  28.  
  29.         dojo.widget.byId('richCart').hijackAllAddToCartNodes();
  30.         },
  31.       formNode: dojo.byId("tab_switchRefreshForm")
  32.       });  
  33.     }
  34. };
The functionality I'm getting is it's working fine in IE, but in FF we get some weird errors. It thinks that it is selecting the wrong tab to begin with (The error I initially stated). When you click on a tab for the first time, everything works fine. The page partially refreshes with only the contents of the tabbed area being changed. However, when you click a tab for the second time, the entire area disapears, and is permanently gone.

I realize that this is rather complex, and I perhaps have provided insufficient code still, but more would probably just be too much for people to help me with in their free time :).

Any help?
Feb 29 '08 #3

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

12 posts views Thread by Jim Tome | last post: by
6 posts views Thread by Dan | last post: by
1 post views Thread by Rob Meade | last post: by
4 posts views Thread by Bosconian | last post: by
3 posts views Thread by JCCDevel | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.