Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 06-11-2012, 04:13 PM   PM User | #1
maximus350zx
New Coder

 
Join Date: Jun 2012
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
maximus350zx is an unknown quantity at this point
Help with Form Design in Javascript

Hello

My Javascript code is coming along well and at present I'm getting my user information using the below code which is working well.

var nam=prompt("Please enter your name","name");

My company has Dreamweaver CS6 licenses so I can install it on my work computer and may use this to create a nice form for my web site and have my user input come from a form rather than a prompt.

For a novice programmer and beginner in web desing, whats the easiest way to make clean looking forms that my javascript code will work with>

Thannks
maximus350zx is offline   Reply With Quote
Old 06-11-2012, 05:59 PM   PM User | #2
Philip M
Supreme Master coder!

 
Philip M's Avatar
 
Join Date: Jun 2002
Location: London, England
Posts: 17,033
Thanks: 197
Thanked 2,410 Times in 2,388 Posts
Philip M has a spectacular aura aboutPhilip M has a spectacular aura aboutPhilip M has a spectacular aura about
Quote:
Originally Posted by maximus350zx View Post
Hello

My Javascript code is coming along well and at present I'm getting my user information using the below code which is working well.

var nam=prompt("Please enter your name","name");

My company has Dreamweaver CS6 licenses so I can install it on my work computer and may use this to create a nice form for my web site and have my user input come from a form rather than a prompt.

For a novice programmer and beginner in web desing, whats the easiest way to make clean looking forms that my javascript code will work with>

Thannks
I am not sure exactly what you mean, but to start with in this century prompt() is not a suitable way of getting user input.

Dreamweaver is not well thought of around here (use the search feature). It produces bloated, poorly-written and old-fashioned code. Forget it!
r
The only sensible advice I can give you is to learn HTML, CSS and Javascript. But that will take more than a few weeks.


All advice is supplied packaged by intellectual weight, and not by volume. Contents may settle slightly in transit.
__________________

All the code given in this post has been tested and is intended to address the question asked.
Unless stated otherwise it is not just a demonstration.
Philip M is offline   Reply With Quote
Old 06-11-2012, 11:04 PM   PM User | #3
jalarie
Regular Coder

 
Join Date: Jun 2002
Location: Flint, Michigan, USA
Posts: 593
Thanks: 1
Thanked 19 Times in 19 Posts
jalarie is an unknown quantity at this point
Start with this and expand to suit:

Code:
<form method="post" action="javascript:void(0);" onsubmit="DoIt();">
 <div class="form">
  <label for="Name">Name:</label>
  <input type="text" size="20" value="name" name="Name" id="Name" alt="input 1" onfocus="this.select();" />
  <br />
  <input type="submit" value="Submit" title="Submit" />&nbsp;
  <input type="reset" value="Reset" title="Reset" />&nbsp; 
 </div>
</form>

<script type="text/javascript">
  /*<![CDATA[*/
    function DoIt() {
      nam=document.forms[0].Name.value;
      alert(nam);
      return true;
    }
  /*]]>*/
</script>
__________________
Visit my site at http://spruce.flint.umich.edu/~jalarie/.
jalarie is offline   Reply With Quote
Reply

Bookmarks

Tags
forms

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 05:59 AM.


Advertisement
Log in to turn off these ads.