innerHTML

Discussion in 'HTML' started by DIANIKA, Nov 19, 2004.

  1. DIANIKA

    DIANIKA Guest

    Hy everyone,
    i'm tryin' to get a dinamic effect using html/javascript: I need to show a
    sentence at the top of a table according to a value in an input text. And I
    need the page doesn't get reloaded.
    I remember something about an innerHTML tag, does anyone has an example?
    tnks in advance
    D.
    DIANIKA, Nov 19, 2004
    #1
    1. Advertising

  2. DIANIKA

    WindAndWaves Guest

    "DIANIKA" <> wrote in message
    news:1wvnd.2828$...
    > Hy everyone,
    > i'm tryin' to get a dinamic effect using html/javascript: I need to show a
    > sentence at the top of a table according to a value in an input text. And

    I
    > need the page doesn't get reloaded.
    > I remember something about an innerHTML tag, does anyone has an example?
    > tnks in advance
    > D.
    >
    >


    I recently did something like that www.corstorphinehouse.com/d/avail.html :

    function showRow(d,m,y,len) {
    if (document.getElementById) {
    var z = document.getElementById('D'+y+m+d)
    // If an in-range date is entered
    if (z){
    hideRows();
    z.style.display = ''
    var j = z.rowIndex;
    // Show as many rows as the length of stay
    for (var i=0; i<len-1; i++) {
    // As long as there are rows to show, show them
    if (z.parentNode.rows[j+i]) {
    z.parentNode.rows[j+i].style.display='';
    // If the length of stay goes past the end of the table, stop trying to show
    more rows
    } else {
    document.getElementById('err').innerHTML = 'You have gone past the end
    of the searcheable period - please contact us directly or try a different
    date.'
    return;
    }
    }
    // otherwise the date is out of range
    } else {
    document.getElementById('err').innerHTML = 'You have entered dates that
    fall outside the searchable period - please contact us directly or try again
    with a different date.';
    hideRows('all');
    }
    }
    }


    function hideRows(a){
    if (document.getElementById) {
    if (a == 'all') {
    var t = document.getElementById('roomAvail').rows;
    for (var i=0; i<t.length; i++) {
    if (t.id != 'D000000' && t.id != '') {
    t.style.display = 'none';
    } else {
    t.style.display = 'block';
    }
    }
    } else {
    var t = document.getElementById('roomAvail').rows;
    for (var i=0; i<t.length; i++) {
    if (t.id != '') {
    t.style.display = 'none';
    }
    }
    }
    }
    }
    WindAndWaves, Nov 20, 2004
    #2
    1. Advertising

  3. DIANIKA

    DIANIKA Guest

    exactly what i need
    thank tou
    "WindAndWaves" <> ha scritto nel messaggio
    news:rXvnd.3837$...
    >
    > "DIANIKA" <> wrote in message
    > news:1wvnd.2828$...
    > > Hy everyone,
    > > i'm tryin' to get a dinamic effect using html/javascript: I need to show

    a
    > > sentence at the top of a table according to a value in an input text.

    And
    > I
    > > need the page doesn't get reloaded.
    > > I remember something about an innerHTML tag, does anyone has an example?
    > > tnks in advance
    > > D.
    > >
    > >

    >
    > I recently did something like that www.corstorphinehouse.com/d/avail.html

    :
    >
    > function showRow(d,m,y,len) {
    > if (document.getElementById) {
    > var z = document.getElementById('D'+y+m+d)
    > // If an in-range date is entered
    > if (z){
    > hideRows();
    > z.style.display = ''
    > var j = z.rowIndex;
    > // Show as many rows as the length of stay
    > for (var i=0; i<len-1; i++) {
    > // As long as there are rows to show, show them
    > if (z.parentNode.rows[j+i]) {
    > z.parentNode.rows[j+i].style.display='';
    > // If the length of stay goes past the end of the table, stop trying to

    show
    > more rows
    > } else {
    > document.getElementById('err').innerHTML = 'You have gone past the

    end
    > of the searcheable period - please contact us directly or try a different
    > date.'
    > return;
    > }
    > }
    > // otherwise the date is out of range
    > } else {
    > document.getElementById('err').innerHTML = 'You have entered dates that
    > fall outside the searchable period - please contact us directly or try

    again
    > with a different date.';
    > hideRows('all');
    > }
    > }
    > }
    >
    >
    > function hideRows(a){
    > if (document.getElementById) {
    > if (a == 'all') {
    > var t = document.getElementById('roomAvail').rows;
    > for (var i=0; i<t.length; i++) {
    > if (t.id != 'D000000' && t.id != '') {
    > t.style.display = 'none';
    > } else {
    > t.style.display = 'block';
    > }
    > }
    > } else {
    > var t = document.getElementById('roomAvail').rows;
    > for (var i=0; i<t.length; i++) {
    > if (t.id != '') {
    > t.style.display = 'none';
    > }
    > }
    > }
    > }
    > }
    >
    >
    >
    DIANIKA, Nov 20, 2004
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Paul
    Replies:
    1
    Views:
    3,201
    bruce barker
    Aug 4, 2003
  2. L Anthony Johnson
    Replies:
    4
    Views:
    7,938
    Michael van den Berg
    Jun 16, 2005
  3. =?Utf-8?B?am9obmRvZUBkcml2ZXIubmV0?=

    BUG: Setting Server Control's InnerHtml forces Constructore to be called.

    =?Utf-8?B?am9obmRvZUBkcml2ZXIubmV0?=, Feb 22, 2004, in forum: ASP .Net
    Replies:
    10
    Views:
    1,516
    Guest
    Feb 24, 2004
  4. m miller

    innerhtml manipulation

    m miller, Mar 2, 2004, in forum: ASP .Net
    Replies:
    5
    Views:
    3,511
    m miller
    Mar 5, 2004
  5. sonic
    Replies:
    5
    Views:
    282
    Randy Webb
    Jul 11, 2006
Loading...

Share This Page