www.webdeveloper.com
Results 1 to 6 of 6

Thread: JS dosent do work with iE not with FF

  1. #1
    Join Date
    Mar 2011
    Posts
    3

    JS dosent do work with iE not with FF

    The form doesnt send amout in FF & chrom but do in IE

    the scrpit

    <script language=javascript>


    function updateField()
    {


    if (document.getElementById("sum").innerHTML >0)
    {
    currentAppID=document.getElementById("newAppID").value;
    if (currentAppID!="")
    {
    document.getElementById('PayFor').innerText = 'Highlight Ad';
    document.getElementById('Amount').innerText = document.getElementById("sum").innerHTML;
    return true;
    }


    the form:



    <input type="hidden" name="Amount" id="Amount" runat=server>
    <input type="hidden" name="Comment" id="Comment" runat=server>
    <input type="hidden" name="Order" id="Order" runat=server>
    <input type="hidden" name="Currency" value="0">
    <input type="hidden" name="PayFor" id="PayFor" runat=server>
    <input type="hidden" name="ReplyType" value="1">
    <input type="submit" value="no" class="buttonOrange" onclick="javascript: return updateField();" style="height: 35px; width: 196px;" >

    </td>
    </tr>
    </table>

  2. #2
    Join Date
    Mar 2011
    Location
    Rome, Italy
    Posts
    101

    onclick

    Try to remove "javascript:return" inside the onclick string, simply like this:
    onclick="updateField()"

  3. #3
    Join Date
    Mar 2011
    Posts
    3

    still not working

    <input type="submit" value="click" class="buttonOrange" onclick="updateField();" style="height: 35px; width: 196px;" >

  4. #4
    Join Date
    Mar 2011
    Location
    Rome, Italy
    Posts
    101

    runat

    Unfortunately from my office desktop i cannot make tests because our internet connection is limited; but i think the "runat" parameter should be added both in the script/form strings like this:
    <script runat="server">...</script>
    <form ... runat="server">...</form>


  5. #5
    Join Date
    Dec 2003
    Location
    Bucharest, ROMANIA
    Posts
    15,428
    Code:
    document.getElementById('PayFor').innerText = 'Highlight Ad';
    document.getElementById('Amount').innerText = document.getElementById("sum").innerHTML;
    I doubt you code ever worked in any browser on this world . The elements of a form have no innerText. The have value

    Another thing: language is deprecated and even obsolete (in the new strict Doctypes) use type instead <script type="text/javascript">

  6. #6
    Join Date
    Mar 2011
    Posts
    3
    DONE!!!
    you are the man, thanks.
    one more happy man for the world :-)

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles