• 1
Votes
name
name Punditsdkoslkdosdkoskdo

How to JavaScript - Getting HTML form values

How can I get the value of an HTML form to pass to JavaScript?

Is this correct? My script takes two arguments one from textbox, one from the dropdown box.

<body>
<form name="valform" action="" method="POST">

Credit Card Validation: <input type="text" id="cctextboxid" name="cctextbox">
Card Type: <select name="cardtype" id="cardtypeid"> </select>
<input type="button" name="submit" value="Verify Credit Card" onclick="isValidCreditCard(document.getElementById('cctextboxid').value,document.getElementById('cardtypeid').value)" /> </body>