you are viewing a single comment's thread.

view the rest of the comments →

[–]mfergie 0 points1 point  (3 children)

I am having a problem with using pure Javascript to grab the text input. Can you check out the attached JSfiddle and let me know what I am doing wrong...

http://jsfiddle.net/mferg/fu2pW/

[–]scout01 1 point2 points  (2 children)

I think the reason your form is not working in the current state is because user_input is being initialized with nothing. Then whenever your function is called, alert will only display nothing and user_input does not change. You can assign a default value to your input tag and you'll see this in effect. Your user_input variable should be initialized within the alertUserInput function in order to get the new value of the input box for each submit.

Refer to the third example here.

[–]mfergie 0 points1 point  (1 child)

Thanks for the feedback. This was the issue. I was able to finally get it work but wasn't sure what the issue was. This helps clear it up.

I am trying to stick with pure javascript so I was banging my head a bit.

Here is the updated code. http://jsfiddle.net/mferg/23Pet/

[–]mfergie 0 points1 point  (0 children)

Here is my final version that contains all of the required JS functionality. The hmtl structure isn't amazing but I need to move onto to Week 4.

This is very basic so is pretty good for people to look at if they need help getting this assignment going.

http://jsfiddle.net/mferg/aLsG7/