![]() |
Basic javascript help
I'm trying to get this code to output first and last name into the 3rd box. It's not working and I'm not sure why. Any help?
*I can't figure out how to put code in here, so I just attached the file. |
I'm not seeing any attachment?
|
Code:
I think it's (bracket)code(bracket)CODE GOES HERE(bracket)/code(bracket).Replace the (bracket) with [ and ] obv. But yeah, nothing attached on my end either. |
Oops. Here it is
HTML Code:
<html> |
Trying to get it to look like this, where the you enter your first and last name, hit GO and it puts your full name in the last box.
COMSC 100 WorkbookAssignment 4 Instructions: Type your first and last name, then click GO and a greeting will appear. Input values: First Name: Last Name: Output value: Happy New Year, |
Code:
function popFull()That's all you need. Call popFull as an onClick in the 'go' button, done. HTML Code:
|
Thanks CW. I'm totally code illiterate, so I'm not sure what to replace to the old code or where to add your code or both? We're supposed to be learning this in class, but the teacher gives the same story about cake and we don't seem to be learning any JS or HTML.
|
What I gave you is basically the completed everything. You only need that one line of javascript to accomplish what you want, and I included the actual necessary portion of the html. You'll need to add like the html/body/etc tags and such, but the meat is all there.
|
If you wanted to do it with your original code (which might be more appropriate for a CSCI 1 assignment) I would ask you to look at the insert function. You are saying WHAT to insert, but not including WHERE.
http://www.prototypejs.org/api/element/insert |
Learn it the efficient way, dammit. Don't learn bloated programming techniques. :)
|
| All times are GMT -5. The time now is 07:34 PM. |
Powered by vBulletin Version 3.6.0
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.