...

View Full Version : Need Help..urgent.



rajeshsivapalan
12-13-2004, 07:42 AM
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

Brandoe85
12-13-2004, 07:58 AM
Try 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'; 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>

rajeshsivapalan
12-13-2004, 08:15 AM
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.

Brandoe85
12-13-2004, 08:19 AM
Change this line:


onblur="if (this.value == '') {this.value='Keyword'; document.form1.Submit.disabled=true;}" maxLength=40 size=10

to this:


onblur="if (this.value == '') {this.value='Keyword'; document.form1.Submit.style.display='none';}" maxLength=40 size=10

rajeshsivapalan
12-13-2004, 08:49 AM
Change this line:


onblur="if (this.value == '') {this.value='Keyword'; document.form1.Submit.disabled=true;}" maxLength=40 size=10

to this:


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

Brandoe85
12-13-2004, 09:04 AM
You're welcome, though I would use the style attribute rather then setting it to an empty string. :thumbsup:

rajeshsivapalan
12-13-2004, 09:15 AM
You're welcome, though I would use the style attribute rather then setting it to an empty string. :thumbsup:

Hi, :thumbsup:

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



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum