If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Simple JavaScript issue that is making my head ache!

I have simple script designed to check if

If a div1 is visible (display : none or block)

if a textfield has any content

The page is designed to show a div section containing 4 text fields that are repeated on the page depending on the above conditions, so if a qty is entered in the first section if would check if the second div is set to display : none and if it is change this to block so it is viewable, it then also checks to see see if they first quantity field is not blank so it does not toggle the form back to none on entering a second figure.

As I said I do not fully understand JavaScript shorthand hence why I asked, Instead of just seeing an answer would it not make more sense to understand why & how first? As I have not seen the IF query written in such a way I would like to not know if there are any restrictions with such a method. A simple "yes it is fine" or "no due to etc. etc" this way I could continue to understand and learn.

How many times have people on forums such this asked questions where they just want the answer or someone to write the code for them which ultimately results in the people replying to lose patience and tell them "why don't you just learn it?"

This is not a rant but merely a request for a little manners and understanding that not all posters are just looking for the solution but also to learn.

dear iainjsimons, i didn't mean to offend you. as you could notice, i am from Russia and this is not my native language. i am learning English by myself here and there from people, mostly at this forum, and perhaps sometimes i don't feel some language nuances. you can easily understand what i am talking about if you try to describe your coding problems in russian and then read the answer written in russian.

anyway, i wrote just what i thought. this is the way i learned and keep learning. testing that double condition could take you a couple of minutes but you didn't just check to see how it works and decided to wait for the answer. why? who am i to take my answers as established truth? you are teaching me manners but let me tell you how your working code was created. usually i do not write any answer without testing it locally on my comp. 99% of people who ask for a help usually provide only a piece of code, so i have to manually add the missing parts of the markup to make a page every time. by the way, the same story about your code. did you see in my post anything like "where is the missing markup?! where are your manners and understanding?!"?

so, do not be so techy, and try to accept people as they are, especially when they help you.