473,385 Members | 1,872 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

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

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

Similar topics

4
by: pablo | last post by:
Dear News Groupers, I'am trying to send a php array with a hidden input field from a form to another script. The array is NOT made directly by way of <input name="arrayname" />. The array is...
12
by: Jim Tome | last post by:
Hi, I am trying to change and pass the value of a hidden input type on a form tag to a cgi processing script based on the value of a checkbox within the form: function CheckBoxes () { if...
6
by: Dan | last post by:
Is there a way to access and set a hidden input types in the code-behind page for ASP.Net? This seems like a common thing that would need to be done, I must be missing something obvious. ...
1
by: Rob Meade | last post by:
Hi all, I have a loop in my code which builds the controls on the page. I at one stage need to add some hidden input controls dynamically, I have achieved this, and I have set their...
4
by: WB | last post by:
Hi, I need to validate a hidden input in my webform to ensure that it's got value. The controls look something like this: <input id="HidSelectedStates" type="hidden" runat="server" /><br...
17
by: SimonWilding | last post by:
I am using a line of javascript that both sets the value of a hidden input element (name='button') and then submits the form. The destination of the post can then pick up the value of the hidden...
4
by: Bosconian | last post by:
I've been fighting with this for an hour. My form contains a hidden input with the value initially set to "". When a user clicks on the link, a function is called that updates the hidden form...
1
by: shaunwo | last post by:
I'm an AJAX / DOM Novice (at best) and trying to figure out how to write the value to a couple input fields. I don't remember exactly where I got the ajax.js file I'm using from (went to the website...
3
by: JCCDevel | last post by:
Hi All, I'm not too proficient in Javascript but am trying to help a friend out. Bascially, the page we are having trouble with is loaded with a numerical value in the url string. Example: ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.