|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
SlickEdit: Code in over 40 languages across 7 platforms. SlickEdit’s unmatched power, speed, and flexibility allows even the most accomplished developers to write better code faster. Download a free trial today! |
|
#1
|
|||
|
|||
|
form validation problem
hiya folks i have a problem with my pae and i cant seem to find any for validation that seems to work.
ive tried a few i have found but no joy .... i want to be able to either disable the on sumbit button on the page untill a value has been added to the drop down menu ..or when the submit button has been clicked alert appears saying no ... size or colour has been selected from the options.. heres the code if you need it .. i really could do with some help with this has i havea paypal shopping basket and if the options in size and colour aint added ..it still ends up in the basket ..which aint good.. <HTML> <HEAD> <TITLE>One Stop Ladies Shop</TITLE> <SCRIPT language=javascript> <!-- if (top.location == location) { top.location="/" } //--> </SCRIPT> </HEAD> <BODY bgColor=#ffffff text="#000000" link="#0000CC" vlink="#0000CC" alink="#0000CC" leftmargin="6" topmargin="6" marginwidth="6" marginheight="6"> <table width="100%" border="0" cellspacing="0" cellpadding="0" height="100%"> <tr> <td align="center" valign="middle"> <form target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post"> <table width="700" border="0" cellspacing="0" cellpadding="0" align="center" height="400"> <tr> <td align="center" valign="middle" height="35"> <b><font face="Verdana, Arial, Helvetica, sans-serif" size="6" color="#0000CC"><b><font face="Verdana, Arial, Helvetica, sans-serif" size="6" color="#0000CC"><br> </font></b></td> <td rowspan="9" valign="middle" align="right" width="300"> <img src="http://onestopladiesshop.idohost.com/skirts/images/761/761-blue-large.jpg" width="300" height="270" vspace="0" border="1" hspace="0"></td> </tr> <tr> <td valign="middle" align="center" height="40"> <font size="6" color="#0000CC" face="Verdana, Arial, Helvetica, sans-serif"><i><i><b><SPAN class=override><font size="4">LADIES LONG EVENING WRAP/SKIRT</font></SPAN> </b></i></i></font></td> </tr> <tr> <td valign="middle" align="center" height="60"><font color="#000000"><SPAN class=override><strong>Colour PALE BLUES<BR> Bust Approx upto <BR> Waist Approx upto 36<BR> Hips Approx upto 42<BR> </font> </td> </tr> <tr> <td align="center" valign="middle" height="65"><font size="5" color="#FF0000" face="Verdana, Arial, Helvetica, sans-serif"><i><b>Our Price<br> £<font size="5" color="#FF0000" face="Verdana, Arial, Helvetica, sans-serif"><i><b>6.99</b></i></font></b></i></font></td> </tr> <tr> <td align="center" valign="middle" height="100"> <table border="1" width="350" cellpadding="1" cellspacing="1"> <tr> <td> <table border="0" cellpadding="0" cellspacing="0" width="100%"> <tr> <td valign="middle" align="center" height="50" width="24%"><font face="Verdana, Arial, Helvetica, sans-serif" size="2"></font><br> </td> <td align="center" valign="middle" height="50" width="38%"><font face="Verdana, Arial, Helvetica, sans-serif" size="2">Size</font><br> <input type="hidden" name="on0" value="size"><select name="os0"> <option value="-" selected>Select Size</option> <option value="12">12</option> <option value="14">14</option> <option value="16">16</option> <option value="18">18</option> <option value="20">20</option> <option value="22">22</option> </select> </td> <td align="center" valign="middle" height="50" width="38%"><font face="Verdana, Arial, Helvetica, sans-serif" size="2">Colour</font><br> <input type="hidden" name="on1" value="colour"><select name="os1"> <option value="-" selected>Select Colour</option> <option value="Blue">Blue</option> </select> </td> </tr> <tr> <td valign="middle" align="center" colspan="3" height="30"> <input type="image" src="http://onestopladiesshop.idohost.com/images/buttons/add_to_order.gif" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!"> <input type="hidden" name="add" value="1"> <input type="hidden" name="cmd" value="_cart"> <input type="hidden" name="business" value="one_stop_ladies_shop@hotmail.com"> <input type="hidden" name="item_name" value="761"> <input type="hidden" name="item_number" value="761"> <input type="hidden" name="amount" value="9.99"> <input type="hidden" name="no_note" value="1"> <input type="hidden" name="currency_code" value="GBP"> <input type="hidden" name="lc" value="GB"> </form> </td> </tr> </table> </td> </tr> </table> </td> </tr> <tr> <td align="center" valign="bottom"><a href="<A href="http://onestopladiesshop.idohost.com/main.htm"target="_self"><img">http://onestopladiesshop.idohost.com/main.htm"target="_self"><img src="/images/bottom/main_menu.gif" width="104" height="20" hspace="0" border="0" alt="Main Menu"></a><img src="" width="8" height="70"><a href=""><img src="" width="119" height="20" hspace="0" border="0" alt="View Basket"></a></td> </tr> </table> <div align="center"> </div> </form> </td> </tr> </table> </BODY> </HTML> |
|
#2
|
|||
|
|||
|
hiya ive had 20 views and no replies on how to put alerts surely someone must know how its done
|
|
#3
|
|||
|
|||
|
I'm not a person with good knowledge about javascript so this question won't help you out. Validation like this should be done serverside, not with javascripts.
|
|
#4
|
|||
|
|||
|
understand what your saying but i have seen it done
i understand what your saying but i have seen it done on a few sites to control the drop down menus
surely there must be a javascript that allows for drop down menus validation |
|
#5
|
|||
|
|||
|
Here is your answer
Where your form starts, change to this (text in red is what is added): <form target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post" onsubmit="return FrontPage_Form1_Validator(this)" name="FrontPage_Form1" language="JavaScript"> THEN Where your "option" starts in your code, add this line (right above your 1st option and before what I show in black) <!--webbot bot="Validation" s-display-name="Size Color or whatever" b-value-required="TRUE" b-disallow-first-item="TRUE" --><select name="os0"> So you only add what I have typed in red and place it where I show you here. Good Luck! www.silvermoongraphics.com |
![]() |
| Viewing: Dev Articles Community Forums > Programming > JavaScript Development > form validation problem |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|