Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
Javascript How-To Ask your "How do I do this with Javascript?" questions here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript How-To section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old January 6th, 2006, 12:25 PM
Friend of Wrox
 
Join Date: Nov 2005
Location: Rotterdam, , Netherlands.
Posts: 223
Thanks: 0
Thanked 0 Times in 0 Posts
Default type hidden DOM

Hi,

I need to make a type="hidden" using javascript
the thing is when I use this:

document.getElementById('currentBox' + Current).checked=true;

it will work in firefox but it doesn't in Firefox.

Does someone knows the solution

thnx

__________________________________________________ ________
This is my junk I'm gona eat it
  #2 (permalink)  
Old January 18th, 2006, 07:00 AM
Friend of Wrox
 
Join Date: Oct 2004
Location: delhi, delhi, India.
Posts: 553
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via MSN to vinod_yadav1919 Send a message via Yahoo to vinod_yadav1919
Default

Hii Dj Kat!!

Have you tried
obj=eval("document.formname.currentBox" + Current)
obj.checked=true


Hope this will help you


Cheers :)

vinod
  #3 (permalink)  
Old January 18th, 2006, 12:38 PM
joefawcett's Avatar
Wrox Author
Points: 9,763, Level: 42
Points: 9,763, Level: 42 Points: 9,763, Level: 42 Points: 9,763, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Exeter, , United Kingdom.
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

Quote:
quote:Originally posted by Dj Kat
 Hi,

I need to make a type="hidden" using javascript
the thing is when I use this:

document.getElementById('currentBox' + Current).checked=true;

it will work in firefox but it doesn't in Firefox.

Does someone knows the solution

thnx
You are to ahve two unrelated pieces of code, you can create a hidden element by using:
Code:
var oHidden = document.createElement("input");
oHidden.type = "hidden";
//append element to parent:
document.getElementById("parentDiv").appendChild(oHidden);
Your other code seems to be tring to access a checkbox, not a hidden field.


--

Joe (Microsoft MVP - XML)


Similar Threads
Thread Thread Starter Forum Replies Last Post
Schema derived type and the base type bonekrusher XML 5 January 8th, 2008 09:04 AM
Guidelines Item 3: Replace System.Type with Type Ixtlia BOOK: Professional .NET 2.0 Generics 0 August 19th, 2007 04:09 AM
how can i restore <input type="hidden"> 's value ? yamunchien ASP.NET 1.0 and 1.1 Basics 4 March 18th, 2006 08:45 PM
Convert "String" type to "Control" type ? kishore_peddi C# 4 January 11th, 2006 01:21 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.