Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7
  1. #1
    New to the CF scene
    Join Date
    Dec 2004
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Need Help..urgent.

    Hi All,
    Seasons best greetings!
    I am new user in this forum...

    I have problem ...

    First have a look at the html and javascript code

    //----------------Put the following in a notepad and save as file.htm and view result.

    <html>
    <head>
    <title>Untitled Document</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

    </head>

    <body>
    <form name="form1" method="post" action="">
    <input
    onblur="if (this.value == '') {this.value='Keyword';}"
    onfocus="if (this.value == 'Keyword') {this.value='';}" maxLength=40 size=10
    value=Keyword name=srchreq default="Keyword" col=""

    onclick= "getElementById('__deepak').innerHTML = '<input name=Submit type=submit value=Go!>' ">

    <div id = "__deepak"></div>

    </form>
    </body>
    </html>

    //---------------------------------

    Issues faced are....

    Issues

    1) Internet Explorer
    It is working fine except on click document event it is not disabling Go button.

    2) Mozilla
    It needs double click on text box to display Go button.

    Thanks and regards
    Rajesh

  • #2
    teh Moderatorinator
    Join Date
    Sep 2004
    Location
    USA
    Posts
    2,472
    Thanks
    4
    Thanked 40 Times in 40 Posts
    Try this:
    Code:
    <html>
    <head>
    <title>Untitled Document</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    
    </head>
    
    <body>
    <form name="form1" method="post" action="">
    <input
    onblur="if (this.value == '') {this.value='Keyword'; document.form1.Submit.disabled=true;}" maxLength=40 size=10
    value=Keyword name=srchreq default="Keyword" col=""
    
    onclick= "getElementById('__deepak').innerHTML = '<input name=Submit type=submit value=Go!>'; if (this.value == 'Keyword') {this.value='';}">
    
    <div id = "__deepak"></div>
    
    </form>
    </body>
    </html>
    Last edited by Brandoe85; 12-13-2004 at 08:07 AM. Reason: had to change something...

  • #3
    New to the CF scene
    Join Date
    Dec 2004
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Remove the button from the document instead of disabling it

    hi
    thanks for the reply, but i need to Remove the button from the document instead of disabling it onclick of the document also the keyword 'text' should appear in the input box.
    thanks Rajesh.

  • #4
    teh Moderatorinator
    Join Date
    Sep 2004
    Location
    USA
    Posts
    2,472
    Thanks
    4
    Thanked 40 Times in 40 Posts
    Change this line:
    Code:
    onblur="if (this.value == '') {this.value='Keyword'; document.form1.Submit.disabled=true;}" maxLength=40 size=10
    to this:
    Code:
    onblur="if (this.value == '') {this.value='Keyword'; document.form1.Submit.style.display='none';}" maxLength=40 size=10
    Last edited by Brandoe85; 12-13-2004 at 08:24 AM.

  • #5
    New to the CF scene
    Join Date
    Dec 2004
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Thanks a lot...

    Quote Originally Posted by Brandoe85
    Change this line:
    Code:
    onblur="if (this.value == '') {this.value='Keyword'; document.form1.Submit.disabled=true;}" maxLength=40 size=10
    to this:
    Code:
    onblur="if (this.value == '') {this.value='Keyword'; document.form1.Submit.style.display='none';}" maxLength=40 size=10
    Hi friend...

    With your reference ...

    I took help from my friend and solved problem like this..

    \\-----------------

    <html>
    <head>
    <title>Untitled Document</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

    </head>

    <body>
    <form name="form1" method="post" action="">
    <input
    onblur="if (this.value == '') {this.value='Keyword'; getElementById('__deepak').innerHTML =' ';}" maxLength=40 size=10
    value=Keyword name=srchreq default="Keyword" col=""

    onclick= "getElementById('__deepak').innerHTML = '<input name=Submit type=submit value=Go!>'; if (this.value == 'Keyword') {this.value='';}">

    <div id = "__deepak"></div>

    </form>
    </body>
    </html>
    \\---------------------------------

    THanks once again..

    Urs pal
    Rajesh

    NOte : by the way whats ur good name

  • #6
    teh Moderatorinator
    Join Date
    Sep 2004
    Location
    USA
    Posts
    2,472
    Thanks
    4
    Thanked 40 Times in 40 Posts
    You're welcome, though I would use the style attribute rather then setting it to an empty string.

  • #7
    New to the CF scene
    Join Date
    Dec 2004
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Thumbs up YEah I used style as per ur suggestion.

    Quote Originally Posted by Brandoe85
    You're welcome, though I would use the style attribute rather then setting it to an empty string.
    Hi,

    I have used style as per ur suggestion. I would like to know if it helps in performance or how it is better than mine option as i could see both works fine.

    regards
    Rajesh


  •  

    Posting Permissions

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