Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Web Programming > JavaScript > Javascript How-To
Password Reminder
Register
Register | FAQ | Members List | Calendar | 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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #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
Reply With Quote
  #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
Reply With Quote
  #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)
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

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



All times are GMT -4. The time now is 05:47 AM.


Powered by vBulletin®
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.