html_code_clinic thread: What is the property to make a field invisible and then visible
Hi,
Thanks, that worked. I had overlooked the button type.
Regards,
Sara
> Hi Sara,
It makes sense to me that the field is not displayed correctly. Take a
look at the button declaration:
<input type="submit"
It's type is set to submit. This means that as soon as the code in the
JavaScript block has been executed, the page is submitted to the server
and then displayed again. Effectively you are refreshing the page.
Change the button declaration to this:
<input type="button"
and it will work.
Cheers,
Imar
> Hi,
> I tried changing the id. It still doesn't work.
> Here is the code. You can paste it into a document and try to run it.
> I have removed the div tag and pasted your code as it is.
> From the code, you can see i have added some alert dialog boxes. Looks
> like it executes the html code again after executing the Javascript
> function, so the field becomes visible for a second and invisible again.
> I arrived at this conclusion as it displays bla bla bla and then xxx on
> the first click of the button. When we click the button again, it should
> display xxx, but it displays bla bla bla which means it execute the html
> code after executing the Javascript function. Doesn't make sense to me. I
> will try to read up further.
>
> Thanks & Regards,
> sara
>