Solved

Ajax form won't submit in ie after modifying css with javascript

Posted on 2008-10-10
4
363 Views
Last Modified: 2013-12-25
I have a form that submits, in both IE7 and FF, but only works in FF. I have isolated the case down to two lines of code in the javascript, however, i need to hide these fields and have the form function as normal.
The reason i can't muck with the HTML/PHP, is because these fields I'm trying to hide need to be on the form, but the data is pulled from another field and placed into those.

//javascript jquery code
$j('#titlediv').attr({ style: "position:absolute;top: -1000px;" }); //hide title div
$j('#postdivrich').attr({ style: "position:absolute;top: -1000px;"}); //hide post div

I've tried doing this the same way with document.getElementById(element).className = 'hideme', but the exact same results occur.
0
Comment
Question by:kevques
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 11

Accepted Solution

by:
bansidhar earned 250 total points
ID: 22688019
try using

document.getElementById(element).style.display='none';

or better use hidden field
<input type="hidden" name="yourelementname" value="" />
0
 
LVL 82

Assisted Solution

by:hielo
hielo earned 250 total points
ID: 22688037
what is $j() doing? Unless you aliased that function, it should be either:
$jQuery('#titlediv').attr({ style: "position:absolute;top: -1000px;" }); //hide title div
$jQuery('#postdivrich').attr({ style: "position:absolute;top: -1000px;"}); //hide post div

OR:
$('#titlediv').attr({ style: "position:absolute;top: -1000px;" }); //hide title div
$('#postdivrich').attr({ style: "position:absolute;top: -1000px;"}); //hide post div
0
 
LVL 11

Expert Comment

by:bansidhar
ID: 22688102
i don't like some element at top: -1000px; creating unnecessary load on the browser when there is much cleaner methods available for hiding an element :)
0

Featured Post

Do you have a plan for Continuity?

It's inevitable. People leave organizations creating a gap in your service. That's where Percona comes in.

See how Pepper.com relies on Percona to:
-Manage their database
-Guarantee data safety and protection
-Provide database expertise that is available for any situation

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

CTAs encourage people to do something specific to show interest in your company, product or service. Keep reading to learn why CTAs should always be thought of as extremely important, albeit small, sections of websites.
Dramatic changes are revolutionizing how we build and use technology. Every company is automating, digitizing, and modernizing operations. We need a better, more connected way to work together as teams so we can harness the insights from our system…
This video teaches users how to migrate an existing Wordpress website to a new domain.
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…

617 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question