I wonder if anyone could explain how I pass the field values in my request form to the PHP processor page. My external javascript file is as follows:
When I click on the Submit button the error page is shown and seems to indicate that fields have not been filled in when, in fact, they have.Code:var sections = ["rqust", "sendr", "reset", "cancel"]; for (var i=0; i < sections.length; i++) { eval(sections[i] + '1 = new Image(100,22)'); eval(sections[i] + '1.src = "images/btn_' + sections[i] + '1.jpg"'); eval(sections[i] + '2 = new Image(100,22)'); eval(sections[i] + '2.src = "images/btn_' + sections[i] + '2.jpg"'); eval(sections[i] + '3 = new Image(100,22)'); eval(sections[i] + '3.src = "images/btn_' + sections[i] + '3.jpg"'); eval(sections[i] + '4 = new Image(64,22)'); eval(sections[i] + '4.src = "images/btn_' + sections[i] + '4.jpg"'); eval(sections[i] + '5 = new Image(64,22)'); eval(sections[i] + '5.src = "images/btn_' + sections[i] + '5.jpg"'); eval(sections[i] + '6 = new Image(64,22)'); eval(sections[i] + '6.src = "images/btn_' + sections[i] + '6.jpg"'); } function switchImage(imgDocID,imgObjName) { document[imgDocID].src = eval(imgObjName + ".src"); } function doSubmit() { window.location='<pathtoprocessor/page.php>' } function doReset() { self.focus(); document.TheForm.lastname.value = ""; document.TheForm.firstname.value = ""; document.TheForm.jobtitle.value = ""; document.TheForm.cmp_org.value = ""; document.TheForm.email.value = ""; }
The code for the form is as follows:
If I use the commented out Standard Submit Button Code the form is processed as expected but the submit button does not follow the rollover and style required.HTML Code:<form action="sbx_rqustproc.php" name="TheForm" method="post" class="form"> <table border="0" cellspacing=0 cellpadding=0> <tr> <td class="firstlabel" width="130">Last Name:</td> <td><input type="text" class="formtext" name="thelastname" id="lastname" size="20" /> <span class="required">*</span></td> </tr> <tr> <td class="label" width="130">First Name:</td> <td class="formfield"><input type="text" class="formtext" name="thefirstname" id="firstname" size="20" /> <span class="required">*</span></td> </tr> <tr> <td class="label" width="130">Job Title:</td> <td class="formfield"><input type="text" class="formtext" name="thejobtitle" id="jobtitle" size="20" /> <span class="required">*</span></td> </tr> <tr> <td class="label" width="130">Company/Org.:</td> <td class="formfield"><input type="text" class="formtext" name="thecmp_org" id="cmp_org" size="20" /> <span class="required">*</span></td> </tr> <tr> <td class="label" width="130">Email Address:</td> <td class="formfield"><input type="text" class="formtext" name="theemail" id="email" size="30" /> <span class="required">*</span></td> </tr> <tr> <td class="label" width="130">Talk Requested:</td> <td class="formfield"><input type="text" class="formtalk" value="<?php echo $mytalk; ?>" name="thetalk" id="talk" size="20" readonly /></td> </tr> </table> <table border="0" cellspacing=0 cellpadding=0> <tr> <div class="formbtns" align="center"> <!-- // Standard Submit Button Code <input type="submit" name="Submit" value="Submit"> --> <a href="javascript:doSubmit();" onmouseover="switchImage('sendr', 'sendr5')" onmouseout="switchImage('sendr', 'sendr6')"> <img src="images/btn_sendr4.jpg" width="64" height="22" name="sendr" border="0" alt="Submit Button"> </a> <a href="javascript:doReset();" onmouseover="switchImage('reset', 'reset5')" onmouseout="switchImage('reset', 'reset6')"> <img src="images/btn_reset4.jpg" width="64" height="22" name="reset" border="0" alt="Reset Button"> </a> <a href="javascript:history.back()" onmouseover="switchImage('cancel', 'cancel5')" onmouseout="switchImage('cancel', 'cancel6')"> <img src="images/btn_cancel4.jpg" width="64" height="22" name="cancel" border="0" alt="Cancel Button"> </a> </div></td> </tr> </table> </form>
Do I need to add some code to the doSubmit() function to send the form values to the php processor page? Can anyone explain what I need to do to make this work?
Any help with this would be appreciated. Thanks in advance.



Reply With Quote


Bookmarks