Javascript form not submitting

My javascript does nothing onsubmit

Page 1 of 1

1 Replies - 660 Views - Last Post: 13 March 2009 - 03:56 AM

#1 FarhanKhalaf  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 12-March 09

Javascript form not submitting

Post icon  Posted 12 March 2009 - 03:19 PM

Hey guys, first post over here. I've been doing javascript for 2 weeks, so bear with me. I basically created form that has all the dynamic features I want, However it does nothing on submit. I have tried changing the action/method - but no go.

Any ideas?

Thanks

 <html>
<head>
<title>10% Off Nordstrom</title>
<script type="text/javascript" src="sidebarscript.js"></script>
<script type="text/stylesheet" src="sidebarstyle.css"></script>
</head>
<body>

<form action="itemreview.php" method="POST">

<label>Enter Item Number:&nbsp;</label> <input class="reqd" type="text" size="15" name="itemnum" />
<p>Verify Item Number: <input class="reqd" type="text" size="15" /></p>


<label>Item Category: </label><select class="reqd" onchange="if (this.selectedIndex==1){this.form['box'].style.visibility='visible'}else {this.form['box'].style.visibility='hidden'}; 
if (this.selectedIndex==2){this.form['box2'].style.visibility='visible'}else {this.form['box2'].style.visibility='hidden'};
if (this.selectedIndex==2){this.form['box2.5'].style.visibility='visible'}else {this.form['box2.5'].style.visibility='hidden'};
if (this.selectedIndex==3){this.form['box3'].style.visibility='visible'}else {this.form['box3'].style.visibility='hidden'};
if (this.selectedIndex==4){this.form['box4'].style.visibility='visible'}else {this.form['box4'].style.visibility='hidden'};
if (this.selectedIndex==5){this.form['box5'].style.visibility='visible'}else {this.form['box5'].style.visibility='hidden'};
if (this.selectedIndex==6){this.form['box6'].style.visibility='visible'}else {this.form['box6'].style.visibility='hidden'};
if (this.selectedIndex==7){this.form['box7'].style.visibility='visible'}else {this.form['box7'].style.visibility='hidden'};
if (this.selectedIndex==8){this.form['box8'].style.visibility='visible'}else {this.form['box8'].style.visibility='hidden'};">
<option value="">Select one</option>
<option value="MT">Men's Top</option>
<option value="MB">Men's Bottoms</option>
<option value="MS">Men's Sneakers</option>
<option value="LT">Lady's Top</option>
<option value="LD">Lady's Dress</option>
<option value="LB">Lady's Bottoms</option>
<option value="LS">Lady's Shoes</option>
<option value="AO">Accessory(Other)</option>
</select>

<br /><br />

<span>Item Size: </span><select class="reqd" style="visibility:hidden; position:absolute; top:120px; left: 107px;" type="text" name="box">
<option value="">Select</option>
<option value="S">Small</option>
<option value="M">Medium</option>
<option value="L">Large</option>
<option value="XL">X-Large</option>
<option value="XXL">XX-Large</option>
</select>

<select class="reqd" style="visibility:hidden; position:absolute; top:120px; left: 87px;" type="text" name="box2">
<option value="">Waist</option>
<option value="28">28</option>
<option value="29">29</option>
<option value="30">30</option>
<option value="31">31</option>
<option value="32">32</option>
<option value="33">33</option>
<option value="34">34</option>
<option value="35">36</option>
<option value="36">37</option>
<option value="37">38</option>
</select>

<select class="reqd" style="visibility:hidden; position:absolute; top:120px; left: 177px;" type="text" name="box2.5">
<option value="">Length</option>
<option value="28">28</option>
<option value="29">29</option>
<option value="30">30</option>
<option value="31">31</option>
<option value="32">32</option>
<option value="33">33</option>
<option value="34">34</option>
<option value="36">36</option>
</select>

<select class="reqd" style="visibility:hidden; position:absolute; top:120px; left: 147px;" type="text" name="box3">
<option value="">Select</option>
<option value="7">7</option>
<option value="7.5">7.5</option>
<option value="8">8</option>
<option value="8.5">8.5</option>
<option value="9">9</option>
<option value="9.5">9.5</option>
<option value="10">10</option>
<option value="10.5">10.5</option>
<option value="11">11</option>
<option value="11.5">11.5</option>
<option value="12">12</option>
<option value="12.5">12.5</option>
<option value="13">13</option>
</select>

<select class="reqd" style="visibility:hidden; position:absolute; top:120px; left: 147px;" type="text" name="box4">
<option value="">Select</option>
<option value="XS">X-Small</option>
<option value="S">Small</option>
<option value="M">Medium</option>
<option value="L">Large</option>
<option value="XL">X-Large</option>
</select>

<select class="reqd" style="visibility:hidden; position:absolute; top:120px; left: 147px;" type="text" name="box5">
<option value="">Select</option>
<option value="0">0</option>
<option value="2">2</option>
<option value="4">4</option>
<option value="6">6</option>
<option value="8">8</option>
<option value="10">10</option>
<option value="12">12</option>
<option value="14">14</option>
</select>

<select class="reqd" style="visibility:hidden; position:absolute; top:120px; left: 147px;" type="text" name="box6">
<option value="">Select</option>
<option value="24">24</option>
<option value="25">25</option>
<option value="26">26</option>
<option value="27">27</option>
<option value="28">28</option>
<option value="29">29</option>
<option value="30">30</option>
<option value="31">31</option>
<option value="32">32</option>
</select>

<select class="reqd" style="visibility:hidden; position:absolute; top:120px; left: 147px;" type="text" name="box7">
<option value="">Select</option>
<option value="5">5</option>
<option value="5.5">5.5</option>
<option value="6">6</option>
<option value="6.5">6.5</option>
<option value="7">7</option>
<option value="7.5">7.5</option>
<option value="8">8</option>
<option value="8.5">8.5</option>
<option value="9">9</option>
<option value="9.5">9.5</option>
<option value="10">10</option>
<option value="10.5">10.5</option>
<option value="11">11</option>
</select>


<input class="reqd" style="visibility:hidden; position:absolute; top:120px; left: 107px;" type="text" name="box8" size="20" value="Specify..."/>

<br />
<br />

<label>Item Color: </label><input class="reqd" style="position: absolute; left: 107px;" type="text" size="20" />

<br />
<br />

<input type="submit" value="Submit" />

</form>

</body>
</html> 


Is This A Good Question/Topic? 0
  • +

Replies To: Javascript form not submitting

#2 roudard  Icon User is offline

  • D.I.C Head

Reputation: 17
  • View blog
  • Posts: 143
  • Joined: 26-September 05

Re: Javascript form not submitting

Posted 13 March 2009 - 03:56 AM

hi,

a few things i noticed upon first check ...
1. to link your css file don't use the <script> tag but the <link> tag
2. you have 2 text fields that don't have a name attribute :
<p>Verify Item Number: <input class="reqd" type="text" size="15" /></p>
//[...]
<label>Item Color: </label><input class="reqd" style="position: absolute; left: 107px;" type="text" size="20" />


I don't know if you want to do something with them, if you do, define them with a name
3. The item category Select doesn't have name either
4. The select tags don't need type=text - i don't think it does any harm, but it's not useful

what's not working exactly ?
it's hard to troubleshoot further without the code of itemreview.php
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1