IT Community - Software Programming, Web Development and Technical Support

Problem in IE

This is a discussion on Problem in IE within the HTML, CSS and Javascript Coding Techniques forums, part of the Web Development category; Hi all, My following code is working fine in Firefox. But not in IE. Can anybody help me? Code: function ...


Go Back   IT Community - Software Programming, Web Development and Technical Support > Web Development > HTML, CSS and Javascript Coding Techniques

Register FAQ Members List Calendar Mark Forums Read
  #1 (permalink)  
Old 10-11-2007, 06:43 AM
krishnakumar krishnakumar is offline
D-Web Analyst
 
Join Date: May 2007
Posts: 206
krishnakumar is on a distinguished road
Question Problem in IE

Hi all,

My following code is working fine in Firefox. But not in IE. Can anybody help me?

Code:
function show(rid)
  {
    current=(document.getElementById(rid).style.display == 'none') ? 'block' : 'none';
  	if (document.getElementById(rid).style.display=='') current='block';
    document.getElementById(rid).style.display = current;
  }
__________________
Krishnakumar.S
Beware of Everything -that is un true; stick to the Truth shall succeed slowly but steadily
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 10-11-2007, 11:44 PM
S.Vinothkumar S.Vinothkumar is offline
D-Web Genius
 
Join Date: May 2007
Posts: 1,061
S.Vinothkumar is on a distinguished road
Cool Re: Problem in IE

hey krishna,

try this...

Code:
document.getElementById(rid).style.display==''
__________________
S.VinothkumaR
Behind me is infinite power,
Before me is Endless Possibility,
Around me is Boundless Opportunity,
Why should I fear!
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 10-13-2007, 12:48 AM
krishnakumar krishnakumar is offline
D-Web Analyst
 
Join Date: May 2007
Posts: 206
krishnakumar is on a distinguished road
Exclamation Re: Problem in IE

Doesn't work with the follows,

Code:
document.getElementById(rid).style.display=='current'
Code:
document.getElementById(rid).style.display=='none'
__________________
Krishnakumar.S
Beware of Everything -that is un true; stick to the Truth shall succeed slowly but steadily
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 10-13-2007, 06:45 AM
S.Vinothkumar S.Vinothkumar is offline
D-Web Genius
 
Join Date: May 2007
Posts: 1,061
S.Vinothkumar is on a distinguished road
Default Re: Problem in IE

Hi buddy,

Can u put your full code?
__________________
S.VinothkumaR
Behind me is infinite power,
Before me is Endless Possibility,
Around me is Boundless Opportunity,
Why should I fear!
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 10-17-2007, 08:56 AM
krishnakumar krishnakumar is offline
D-Web Analyst
 
Join Date: May 2007
Posts: 206
krishnakumar is on a distinguished road
Default Re: Problem in IE

My function is,

Code:
function show2(rid)
  {
    current=(document.getElementById(rid).style.display == 'none') ? 'block' : 'none';
  	if (document.getElementById(rid).style.display=='') current='block';
    document.getElementById(rid).style.display = current;
  }
Code:
<input type='radio' name='ship_address' value='new' onclick="show('form1'); return false;">
__________________
Krishnakumar.S
Beware of Everything -that is un true; stick to the Truth shall succeed slowly but steadily
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 10-19-2007, 01:40 AM
S.Vinothkumar S.Vinothkumar is offline
D-Web Genius
 
Join Date: May 2007
Posts: 1,061
S.Vinothkumar is on a distinguished road
Question Re: Problem in IE

Does the element have a (unique) id 'form' ?
__________________
S.VinothkumaR
Behind me is infinite power,
Before me is Endless Possibility,
Around me is Boundless Opportunity,
Why should I fear!
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 11-12-2007, 11:33 PM
krishnakumar krishnakumar is offline
D-Web Analyst
 
Join Date: May 2007
Posts: 206
krishnakumar is on a distinguished road
Default Re: Problem in IE

I think so…

Code:
<div id="form1"></div>
__________________
Krishnakumar.S
Beware of Everything -that is un true; stick to the Truth shall succeed slowly but steadily
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 11-13-2007, 03:06 AM
bermuda bermuda is offline
D-Web Trainee
 
Join Date: Oct 2007
Posts: 10
bermuda is on a distinguished road
Default Re: Problem in IE

Have you tried the code snipet in both IE 6 and 7?
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #9 (permalink)  
Old 11-14-2007, 01:43 AM
krishnakumar krishnakumar is offline
D-Web Analyst
 
Join Date: May 2007
Posts: 206
krishnakumar is on a distinguished road
Default Re: Problem in IE

Yes...I tried...
__________________
Krishnakumar.S
Beware of Everything -that is un true; stick to the Truth shall succeed slowly but steadily
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #10 (permalink)  
Old 11-14-2007, 11:04 PM
S.Vinothkumar S.Vinothkumar is offline
D-Web Genius
 
Join Date: May 2007
Posts: 1,061
S.Vinothkumar is on a distinguished road
Wink Re: Problem in IE

Oh buddy, If the id exists then the code will work...
__________________
S.VinothkumaR
Behind me is infinite power,
Before me is Endless Possibility,
Around me is Boundless Opportunity,
Why should I fear!
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #11 (permalink)  
Old 11-16-2007, 10:21 PM
krishnakumar krishnakumar is offline
D-Web Analyst
 
Join Date: May 2007
Posts: 206
krishnakumar is on a distinguished road
Wink Re: Problem in IE

Yes buddy…Actually On the page there are two different forms each with its id (form1 and form2). But still the function doesn't work with Internet Explorer…
__________________
Krishnakumar.S
Beware of Everything -that is un true; stick to the Truth shall succeed slowly but steadily
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #12 (permalink)  
Old 11-16-2007, 11:08 PM
vims vims is offline
D-Web Programmer
 
Join Date: Oct 2007
Posts: 67
vims is on a distinguished road
Wink Re: Problem in IE

Hi..

Modify the function like this and it is working

Code:
function show2(rid)
{
	current=(document.getElementById(rid).style.display == 'none') ? 'block' : 'none';
	document.getElementById(rid).style.display = current;
}
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #13 (permalink)  
Old 11-19-2007, 01:21 AM
S.Vinothkumar S.Vinothkumar is offline
D-Web Genius
 
Join Date: May 2007
Posts: 1,061
S.Vinothkumar is on a distinguished road
Exclamation Re: Problem in IE

Quote:
Originally Posted by krishnakumar View Post
Yes buddy…Actually On the page there are two different forms each with its id (form1 and form2). But still the function doesn't work with Internet Explorer…
Hi krishna!

Can you show the document or give a link?
__________________
S.VinothkumaR
Behind me is infinite power,
Before me is Endless Possibility,
Around me is Boundless Opportunity,
Why should I fear!
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #14 (permalink)  
Old 11-28-2007, 09:51 PM
krishnakumar krishnakumar is offline
D-Web Analyst
 
Join Date: May 2007
Posts: 206
krishnakumar is on a distinguished road
Smile Re: Problem in IE

Ya sure vinoth!

check it out my code,....

Code:
if($action=="checkout") { 
        $cart_query=mysql_query("SELECT * FROM cart WHERE userid=$uid") or die ("Cant2: " . mysql_error()); 
        ?> 
        <div class="baginfo"> 
                <table width="700" cellspacing="0" cellpadding="0" border="0" align="center"> 
                    <tr> 
                        <table width="500" cellspacing="0" cellpadding="0" border="0" align="center"> 
                            <tr bgcolor="#cbcbcb"> 
                                <td width="300"> 
                                    Produs 
                                </td> 
                                <td width="100">     
                                    Cantitate 
                                </td> 
                                 
                                <td width="100"> 
                                    Pret 
                                </td> 
                            </tr> 
                            <?php 
                            $total_total=0; 
                            while($cart=mysql_fetch_array($cart_query)) { 
                                $product_query=mysql_query("SELECT * FROM products WHERE id=$cart[pid]"); 
                                $product=mysql_fetch_array($product_query); 
                                ?> 
                                <tr> 
                                <td> 
                                    <?php echo $product[name]; ?> 
                                </td> 
                                <td> 
                                    <?php echo $cart[qty]; ?> 
                                </td> 
                                <td> 
                                    <?php $total = $cart[qty] * $product[price]; 
                                    $total_total = $total_total + $total; 
                                    echo $total; ?> 
                                </td> 
                            </tr> 
                            <?php 
                            } 
                            ?> 
                             
                            <tr> 
                                <td height="1" colspan="3" bgcolor="#cbcbcb"> 
                                </td> 
                            </tr> 
                                <tr> 
                                <td colspan="3" bgcolor="#eaeaea" align="right"> 
                                    Total : <?php echo $total_total; ?> RON 
                                </td> 
                            </tr> 
                            <tr> 
                                <td colspan="3"> 
                                    <form name="mainform" method="post" action="index.php?go=cart&action=pay"> 
                                    Platesc cu:<br> 
                                    <input type="radio" name="pay_method" value="card">Card Bancar<br> 
                                    <input type="radio" name="pay_method" value="op">Ordin de Plata<br> 
                                    <input type="radio" name="pay_method" value="ramburs">Ramburs Curier<br> 
                                </td> 
                            </tr> 
                            <tr> 
                                <td height="1" colspan="3" bgcolor="#cbcbcb"> 
                                </td> 
                            </tr> 
                            <tr> 
                                <td colspan="2"> 
                                    Produsele comandate vor fi livrate la adresa: <br> 
                                    <?php 
                                    $address_query=mysql_query("SELECT * FROM address WHERE userid=$uid") or die ("Cant: " . mysql_error()); 
                                    while($address=mysql_fetch_array($address_query)) { 
                                        echo "<input type='radio' name='ship_address' value='$address[id]'>$address[line]<br>"; 
                                    } 
                                    ?> 
                                    <input type='radio' name='ship_address' value='new' onclick="show('form1'); return false;">Adauga adresa noua<br> 
                                    <style> 
                                    #form1 { 
                                    display: none; 
                                    } 
                                    #form2 { 
                                    display: none; 
                                    } 
                                    </style> 
                                     
                                     
                                    <div id="form1"> 
                                     
                                    Adresa: <textarea name="address_line"></textarea> 
                                    <br>Localitatea: <input type="text" name="address_localitatea"><br> 
                                    Judet: <select id="judet" name="address_judet" class="inputcp"><option value="">----</option></select> 
                                    <input type="submit" value="Adauga" name="addaddress"> 
                                     
                                    </div> 
                                     
                                     
                                </td> 
                                <td> 
                                    <a href='index.php?go=cp&action=personal_address&refer=checkout'>Modifica</a> 
                                </td> 
                            </tr> 
                            <tr> 
                                <td height="1" colspan="3" bgcolor="#cbcbcb"> 
                                </td> 
                            </tr> 
                            <tr> 
                                <td colspan="2"> 
                                    Factura va fi emisa pe: <br> 
                                    <input type="radio" name="billing_address" value="personal"><?php echo $user[firstname] . " " . $user[lastname]; ?><br> 
                                    <?php 
                                    $company_address_query=mysql_query("SELECT * FROM company_address WHERE userid=$uid"); 
                                    while($company_address=mysql_fetch_array($company_address_query)) { 
                                        echo "<input type='radio' name='billing_address' value='$company_address[id]'>$company_address[name]<br>"; 
                                    } 
                                    ?> 
                                    <input type="radio" name="billing_address" value="new" onclick="show('form2'); return false;">Adauga adresa<br> 
                                     
                                     
                                    <div id="form2"> 
                                    <input type="hidden" name="uid" value="<?php echo $user[id]; ?>"> 
                                        <b>* Nume Companie:</b> 
                                     
                                        <input name="name"  size="30" maxlength="50" type="text" class="inputcp"> 
                                     
                                        <b>* Banca:</b> 
                                     
                                        <input name="bank"  size="30" maxlength="50" type="text" class="inputcp"> 
                                     
                                        <b>* CIF:</b> 
                                     
                                        <b>RO</b> - <input name="cif"  size="28" maxlength="50" type="text" class="inputcp2"> 
                                     
                                        <b>* Cont Banca:</b> 
                                     
                                        <input name="cont"  size="30" maxlength="50" type="text" class="inputcp"> 
                                     
                                        <b>* Reg. Com.:</b> 
                                     
                                        <select style="margin: 0pt; width: 35px;" id="J" name="r1"> 
            <option value="J">J</option> 
            <option value="F">F</option> 
        </select> 
        / 
        <select style="margin: 0pt; width: 38px;" id="J1" name="r2"> 

            <option value="">--</option> 
            <option value="01">01</option> 
            <option value="02">02</option> 
            <option value="03">03</option> 
            <option value="04">04</option> 
            <option value="05">05</option> 

            <option value="06">06</option> 
            <option value="07">07</option> 
            <option value="08">08</option> 
            <option value="09">09</option> 
            <option value="10">10</option> 
            <option value="11">11</option> 

            <option value="12">12</option> 
            <option value="13">13</option> 
            <option value="14">14</option> 
            <option value="15">15</option> 
            <option value="16">16</option> 
            <option value="17">17</option> 

            <option value="18">18</option> 
            <option value="19">19</option> 
            <option value="20">20</option> 
            <option value="21">21</option> 
            <option value="22">22</option> 
            <option value="23">23</option> 

            <option value="24">24</option> 
            <option value="25">25</option> 
            <option value="26">26</option> 
            <option value="27">27</option> 
            <option value="28">28</option> 
            <option value="29">29</option> 

            <option value="30">30</option> 
            <option value="31">31</option> 
            <option value="32">32</option> 
            <option value="33">33</option> 
            <option value="34">34</option> 
            <option value="35">35</option> 

            <option value="36">36</option> 
            <option value="37">37</option> 
            <option value="38">38</option> 
            <option value="39">39</option> 
            <option value="40">40</option>                                                                 
        </select> 
        / 
        <input id="J2" name="r3" value="" maxlength="7" class="casute" style="width: 45px; color: #676767; font-size: 11px;    font-family:Verdana, Arial, Helvetica, sans-serif; font-weight: normal;" type="text"> 

        / 
        <select style="width: 50px;" id="J3" name="r4"> 
            <option value="">--</option> 
            <option value="1990">1990</option> 
            <option value="1991">1991</option> 
            <option value="1992">1992</option> 
            <option value="1993">1993</option> 

            <option value="1994">1994</option> 
            <option value="1995">1995</option> 
            <option value="1996">1996</option> 
            <option value="1997">1997</option> 
            <option value="1998">1998</option> 
            <option value="1999">1999</option> 

            <option value="2000">2000</option> 
            <option value="2001">2001</option> 
            <option value="2002">2002</option> 
            <option value="2003">2003</option> 
            <option value="2004">2004</option> 
            <option value="2005">2005</option> 

            <option value="2006">2006</option> 
            <option value="2007">2007</option>                                                             
        </select> 
                                     
                                        <b>* Adresa:</b> 
                                     
                                        <textarea class="inputcp" name="address" id="street_address" cols="20" rows="3" ></textarea> 
                                     
                                        <b>* Localitatea:</b> 
                                     
                                        <input name="localitatea"  size="30" maxlength="50" type="text" class="inputcp"> 
                                     
                                        <b>* Judet / Sector:</b> 
                                     
                                        <select id="judet" name="judet" class="inputcp"><option value="">----</option></select> 
                                     
                                        <input type="hidden" name="uid" value="<?php echo $uid; ?>"> 
                                        <input type="submit" value="Adauga" name="address2"> 
                                        </div> 
                                </td> 
                                <td> 
                                 
                                <a href='index.php?go=cp&action=company_address&refer=checkout'>Modifica</a> 
                                </td> 
                            </tr> 
                            <tr> 
                                <td height="1" colspan="3" bgcolor="#cbcbcb"> 
                                </td> 
                            </tr> 
                            <tr> 
                                <td colspan="3"> 
                                <p><input type="submit" name="mainform" value="!!!!Cumpar!!!!"> 
                                </form> 
                                </td> 
                            </tr> 
                        </table> 
                        <table> 
                        <tr> 
                        <td> 
                                     
                        </td> 
                        </tr> 
                        </table> 
                     
        <?php 
    }
__________________
Krishnakumar.S
Beware of Everything -that is un true; stick to the Truth shall succeed slowly but steadily
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
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

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
NTVDR Problem Balasubramanian.S C# Programming 2 09-29-2008 06:55 AM
a new problem? saravanan Computer Hardware 0 03-24-2008 07:09 AM
TFS check-in problem arjkhanna ASP and ASP.NET Programming 9 08-16-2007 10:06 AM
Problem on .net 3.0 WPF! theone C# Programming 0 07-19-2007 10:56 PM
DNS problem vadivelanvaidyanathan Server Management 0 07-15-2007 06:49 PM


All times are GMT -7. The time now is 09:28 AM.


Copyright ©2004 - 2007, DiscussWeb. All Rights Reserved.

SEO by vBSEO 3.0.0