Spry validation issue with submit button

Hi,
I'm new to Spry but am having an issue getting it to work at all.  I created a very simply form (i.e. table with Spry text field and submit button).  I've read many articles and been to several forums, but I can't seem to find the issue I'm having.  Basically, when I go to preview the page in a browser, the table with the Spy text field and submit button comes up fine, but when I hit the submit button, I see the page refresh and any values I had in the text field disappear, but nothing ever comes up saying "A value is required," which is what I'm looking for. This happens even if I don't have any values in the text field.  Below are images of what I'm describing and also the code.  I verified that the "Required" check box is checked in the SpryTextField and the submit button action is selected to "Submit Form."  My setup is Win 7, DW6, & XAMPP.  Any help you can provide would be greatly appreciated.
Before Submit Button pressed:
Browser after button pressed: (same as above but no message saying "A value is required.")
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<script src="SpryAssets/SpryValidationTextField.js" type="text/javascript"></script>
<link href="SpryAssets/SpryValidationTextField.css" rel="stylesheet" type="text/css" />
</head>
<body>
test
<table width="600" border="1">
  <tr>
    <td><form id="form1" name="form1" method="post" action="">
      <span id="sprytextfield1">
      <label for="test"></label>
      <input type="text" name="test" id="test" />
      <span class="textfieldRequiredMsg">A value is required.</span><span class="textfieldInvalidFormatMsg">Invalid format.</span></span>
    </form></td>
  </tr>
  <tr>
    <td> </td>
  </tr>
  <tr>
    <td> </td>
  </tr>
  <tr>
    <td> </td>
  </tr>
  <tr>
    <td><form id="form2" name="form2" method="post" action="">
      <input type="submit" name="submit" id="submit" value="Submit" />
    </form></td>
  </tr>
  <tr>
    <td> </td>
  </tr>
</table>
<script type="text/javascript">
var sprytextfield1 = new Spry.Widget.ValidationTextField("sprytextfield1", "email");
</script>
</body>
</html>

Do yourself a big favor and don't waste time with Spry Validation.  Most modern browsers support HTML5 forms with the required attribute. 
If you must placate older browsers, use jQuery validate script.  It's lightweight and works when HTML5 support is missing.  You can see an example below. If you hit submit with empty form fields, the required fields pop-up with messages.  View source in browser to see the code. 
HTML5 Form with jQuery Validation
Nancy O.

Similar Messages

  • Issue with Submit button

    Last October, I created a fillabe form via LiveCycle. I distributed the forms and they all worked initially on the receiver's end. The past couple of months, people have been informing me that the "submit" button has disappeared. Why would this happen? Even I have opened the form on my computer and the submit button is not there, even though it states in the purple bar at the top "to submit form by clicking submit".....Any ideas?

    Hi,
    this is the VBA code we are using.
    The below sheet is the report where user manually writes values and then another input form is attached to this report where the entered values get multiplied by 1000 and then this data gets sent to database.
    The values entered in the below report does not get submitted to database because, save button is grayed out. Only TIME dimension is active on this report to get the time period.
    SUBMIT button is created on the report tab and input schedule is hidden.
    Now the below screenshot is the migrated evdre input shedule where data from 1st report gets multiplied  by 1000 and then submitted to database.
    SUBMIT button is created on the report tab and input schedule is hidden.
    On the above lines, we have 2 more reports and 2 more input schedules in the same Input schedule. That is to say, we have 3 report sheets and 3 input sheets in 1 single report.
    SUBMIT button is configured on all the three report sheets and input schedule sheets are hidden.
    To reiterate the issue again, when we click on submit button the screen flickers and goes through all the reports and when data is submitted the screen appears to the same report from where submit button is clicked.
    Please let me know if you need more infromation.
    Regards,
    Ashwin.

  • I have an InfoPath with submit button, publish the same to form library.

    Hi All,
    i have an InfoPath with submit button, publish the same to form library.
    Now, i open the form  fill it and attach some files, when i press submit button, that attachments will go to the particular document library.
    Can any one help me out.
    Thanks in Advance!

    Hi Anil,
    According to your description, my understanding is that the attachments attached to the form were submitted to an documents library.
    By default, the attachments should be attached with the InfoPath form and will not be submitted anywhere.
    There may be some customizations on the form that is to submit the attachments to the document library.
    Please check the links below if the customizations are made in the form.
    http://www.bizsupportonline.net/blog/2010/01/upload-document-sharepoint-infopath-form/
    http://www.bizsupportonline.net/blog/2010/04/top-10-questions-infopath-file-attachments/
     Best regards.
    Thanks
    Victoria Xia
    TechNet Community Support

  • Associating two events with submit button using  javascript in jsp

    Hi
    How can i Associate two events with submit button using javascript in jsp. Firstly it should insert the data to database and secondly it should close the same pop-up window

    Have something like :
    <input type="submit" name="submitbtn" value="Click me" onClick="function1(); function2(); " />
    You just call both functions sequentially, it's that simple. Although using javascript to work with a database, that seems a bit tricky.

  • HT204291 Since upgrading to iOS7, i have experienced issues with Airplay button missing

    Since upgrading to iOS7, i have experienced issues with Airplay button missing from the control menu as well as in Spotify.  It is as if airplay is not runing.  A temp fix: Reboot of the ipad mini (Home button+standby) Is there anything permanent?
    I have verified that my iPad mini and apple TV is up to date.
    Airplay enabled, the network is connected with internet.
    It is as if, airplay is a service that just stopped working and has to be restarted again via a reboot.

    Welcome to the Apple Community.
    Intermittent problems are often a result of interference. Interference can be caused by other networks in the neighbourhood or from household electrical items.
    You can download and install iStumbler (NetStumbler for windows users) to help you see which channels are used by neighbouring networks so that you can avoid them, but iStumbler will not see household items.
    Refer to your router manual for instructions on changing your wifi channel or adjusting your multicast rate.
    There are other types of problems that can affect networks, but this is by far the most common, hence worth mentioning first. Networks that have inherent issues can be seen to work differently with different versions of the same software. You might also try moving the Apple TV away from other electrical equipment.
    The following article(s) may help you.
    Troubleshooting AirPlay
    Troubleshooting Wi-Fi networks and connections
    Recommended Wi-Fi settings
    Troubleshooting Security Software

  • I was online earlier this week and liked the forms with submit buttons and the Adobe site directed me to upgrade to Adobe PRO XI in order to use forms so I bought five licenses. Just had it installed today and it is now asking me to sign up for forms Cent

    I was online earlier this week and liked the forms with submit buttons and the Adobe site directed me to upgrade to Adobe PRO XI in order to use forms so I bought five licenses. Just had it installed today and it is now asking me to sign up for forms Central in order to use this feature. What gives? The Adobe site gave me the impression that I would have this feature after purchasing the new upgrade. I would not have purchased the upgrade, let alone five of them had I know this. Am I missing something?

    Acrobat XI comes with the Fromscentral AIR application and the ability to create PDF forms authored in Formscentral. To have more than the free (1 form with 50 responses) level account you need to sign up for a Formscentral subscription.
    Andrew

  • Validation issues with form (was: Validation)

    I am having validation issues with my form.  Even after I put in a name and last name it says the entries are invalid.  Could this be a hosting problem?  www.bussmanncomputers.net/Nx

    Below is mail form from my isp, which is Godaddy:
    This is the form that I am having some problems with configuring.
    <?php
    if ( !isset($_SERVER['SPI'])) {
            die();
    if (!isset($_SERVER['DOCUMENT_ROOT'])) {
            echo("CRITICAL: we seem to be running outside of the norm.\n");
            header("Location: http://".$_SERVER["HTTP_HOST"]."/");
            die("CRITICAL: Document root unavailable.\n");
    $request_method = $_SERVER["REQUEST_METHOD"];
    if($request_method == "GET") {
            $query_vars = $_GET;
    elseif ($request_method == "POST") {
            $query_vars = $_POST;
    reset($query_vars);
    function customsort($a,$b) {
            // $a is array for form vars, $b is comma seperated case sensitive field order
            // this is case sensitive -- good idea to hrc that.
            $data = array();
            if ( strstr($b,',') == FALSE )  {
                    $b = $b.",";
            $ordering = split(',',$b);
            foreach ($ordering as $orderitem) {
                    if ( ($orderitem != null) && ($orderitem != "") ) {
                            if (isset($a[$orderitem])) {
                                    $data[$orderitem] = $a[$orderitem];
            foreach ($a as $key=>$val) {
                    $data[$key] = $a[$key];
            return $data;
    function xmlentities($string) {
            return str_replace ( array('&', '"', "'", '<', '>'), array('&amp;', '&quot;', '&apos;', '&lt;', '&gt;'), $string);
    $t = date("U");
    $formhomedir = preg_replace('/.*\/home\/content/','',$_SERVER['DOCUMENT_ROOT']);
    $formhomedir = explode('/',$formhomedir);
    if (count($formhomedir) <= 4) {
            $formhome="/home/content/".$formhomedir[1]."/".$formhomedir[2]."/data/";
    else {
            $formhome="/home/content/".$formhomedir[1]."/".$formhomedir[2]."/".$formhomedir[3]."/".$f ormhomedir[4]."/data/";
    $file_order = ".default";
    $file_format = ".text";
    $file_interval = ".15m";
    $field_order = "";
    if (isset($query_vars['form_order'])) {
            if ($query_vars['form_order'] != "alpha") {
                    $field_order=$query_vars['form_order'];
                    $file_order=".custom";
                    $query_vars = customsort($query_vars,$field_order);
            else {
                    switch ($query_vars['form_order']) {
                            case "alpha":
                                    uksort($query_vars,'strnatcasecmp');
                                    $file_order=".alpha";
                            break;
                            default:
                                    $file_order=".default";
                            break;
    if (isset($query_vars['form_format'])) {
            switch ($query_vars['form_format']) {
                    case "csv":
                            $file_format = ".csv";
                    break;
                    case "html":
                            $file_format = ".html";
                    break;
                    case "xml":
                            $file_format = ".xml";
                    break;
                    case "text":
                    case "default":
                    default:
                            $file_format = ".text";
                    break;
    if (isset($query_vars['form_delivery'])) {
            switch ($query_vars['form_delivery']) {
                    case "hourly":
                            $file_interval = ".60m";
                    break;
                    case "hourly_digest":
                            $file_interval = ".60mc";
                    break;
                    case "daily":
                            $file_interval = ".24h";
                    break;
                    case "daily_digest":
                            $file_interval = ".24hc";
                    break;
                    case "digest":
                            $file_interval = ".15mc";
                    break;
                    case "default":
                    default:
                            $file_interval = ".15m";
                    break;
    $file = $formhome."form_".$t.$file_order.$file_format.$file_interval;
    $fp = fopen($file,"w");
    reset($query_vars);
    switch ($file_format) {
            case ".csv":
                    $csvkeys = "";
                    $csvvals= "";
                    $firsttime = "";
                    while (list ($key, $val) = each ($query_vars)) {
                            if ( ($key == "form_order") ||
                                    ($key == "form_format") ||
                                    ($key == "form_delivery") ||
                                    ($key == "redirect") ) {
                            else {
                                    if ($csvkeys != "") {
                                            $firsttime=",";
                                    $tmpkey=escapeshellcmd($key);
                                    $csvkeys = $csvkeys.$firsttime."'".$tmpkey."'";
                                    $tmpval=escapeshellcmd($val);
                                    $csvvals = $csvvals.$firsttime."'".$tmpval."'";
                    fputs($fp,"$csvkeys\n");
                    fputs($fp,"$csvvals\n");
            break;
            case ".html":
                    fputs($fp,"<table border=\"1\" cellspacing=\"1\" cellpadding=\"2\">\n");
            break;
            case ".xml":
                    fputs($fp,"<form>\n");
            break;
    reset($query_vars);
    while (list ($key, $val) = each ($query_vars)) {
            if ($key == "redirect") {
                    $landing_page = $val;
            if ( ($key == "form_order") ||
                    ($key == "form_format") ||
                    ($key == "form_delivery") ||
                    ($key == "redirect") ) {
            else {
                    switch ($file_format) {
                            case ".html":
                                    fputs($fp,"\t<tr>\n");
                                    fputs($fp,"\t\t<td><b>$key</b></td>\n");
                                    fputs($fp,"\t\t<td>$val</td>\n");
                                    fputs($fp,"\t</tr>\n");
                            break;
                            case ".csv":
                                    // content is already output
                            break;
                            case ".xml":
                                    fputs($fp,"\t<field>\n");
                                    fputs($fp,"\t\t<fieldname>".xmlentities($key)."</fieldname>\n");
                                    fputs($fp,"\t\t<fieldvalue>".xmlentities($val)."</fieldvalue>\n");
                                    fputs($fp,"\t</field>\n");
                            break;
                            case ".text":
                            default:
                                    fputs($fp,$key.": ".$val."\n");
                            break;
    switch ($file_format) {
            case ".html":
                    fputs($fp,"</table>\n");
            break;
            case ".xml":
                    fputs($fp,"</form>\n");
            break;
    fclose($fp);
    if ($landing_page != "") {
            header("Location: http://".$_SERVER["HTTP_HOST"]."/$landing_page");
    else {
            header("Location: http://".$_SERVER["HTTP_HOST"]."/");
    ?>

  • Anyone have an issue withe airplay button not being available?

    Anyone have an issue withe airplay button not being available?

    Since the last pair of updates, my game camera won't pan around in any adventure level, leaving many sub levels off screen.  This is happening in all community adventure levels as well as my own on my moon.  Also can't seem to decorate my adventure levels without experiencing major glitches, especially with changing the materials.  The updates fixed a lot of stuff, but it seems like they trashed some things too.

  • Spry Validation Checkbox with an ASP button

    Is there any way to get the Spry Validation Check box
    JavaScript to fire when a asp button is clicked. I noticed that is
    was originally written for an HTML submit type. If my question
    seems juvenile I apologize but my brain is racked with other issues
    concerning the web page I am developing. Thanks in advance

    Do yourself a big favor and don't waste time with Spry Validation.  Most modern browsers support HTML5 forms with the required attribute. 
    If you must placate older browsers, use jQuery validate script.  It's lightweight and works when HTML5 support is missing.  You can see an example below. If you hit submit with empty form fields, the required fields pop-up with messages.  View source in browser to see the code. 
    HTML5 Form with jQuery Validation
    Nancy O.

  • Spry validations fails with different submit btn

    Hello,
    I have a form with spry validation, works great. The moment I
    add this as the submit button rather then the normal submit the
    spry validation will not longer work:
    <input name="submitbutton" type="button"
    class="submitbutton" onclick="if(this.value == 'Submit Order')
    this.form.submit(); this.value = 'Processing Your Order!! Do not
    click again.';" value="Submit Order" />
    Really want to flip out the submit button after click like
    this...anyone have suggestions to get this working?
    -Joe

    I only added one line -- return ray.ajax(); -- when all validation has been passed right before return come true.
    I wish I could do it with the Spry Validation too. Any ideas?.

  • Client side validation with submit button in another region

    Hi,
    I have two regions, one containing a form with input texts for the user to fill in, and another region with a command button. A few of the input fields use the ADF "required" validator.
    My problem is that when I click the submit button, and it does some logic to commit the form to a data base, even if the validator triggers and says that one of the required fields is empty, all the other fields get committed, except the ones that are empty. They get the last valid value.
    What I want is the button to trigger the ADF message that doesn't allow the user to continue with the update. This doesn't happen though.
    Anyone have any ideas? If you need a more thorough explanation, please let me know.

    Regions work as indipendent pages.
    Yet if submit buttons are partialSubmit="false" then both regions (pages are submited).
    Still there is a bug when commiting data:
    [http://adfbugs.blogspot.com/2009/08/page-with-region-validations-bug.html]

  • Fighting with Submit Button and Return Address / distributing Forms

    I go crazy, too ! We designed some smart forms for a new evaluation process, too, and had a successfully test within our IT collegues. Now we handed the process over to the users, and the problems are on!
    We made sure that everyone uses the same version of Adobe 9.1.2 Pro - but not 2 users do have the same results.
    We found following 2 major issues:
    1) When opening the _distributed.pdf - users either completly missing the pink bar with  Highlight fields / Submit Form
    or, very odd, just the Submit Form button
    2) For those who fortunatly have the Submit Button, another odd thing happens:
    The Send form correctly shows the to: address .....
    Our Desktop Email Application is Notes...
    Guess what .... Now the Email adress changes to [email protected]   ( this worked fine in our testings before...)
    Do you have any clue from where this address is pulled ???? We checked the identitity Info in the Adobe installation at the users computers, the email and name entries are correct there.....
    Please help !!!

    I am pretty sure the answer is in the script. I have put together pieces of script from other suggestions and I am pretty sure I have ascrewed something up  along teh way. I have looked at the attached link and that is where I got some of the script you see below. I am sure you will refer to me as the hatchet person who chopped the script up. sorry. (It is in the Mouse Up) This does work, sort of...It will give the user the message that the required fields are not filed in if they are blank, but it will send the email, but without the custom message in the subject line.
    if (employeename.rawValue != null || employeename.rawValue != "") {
    vSubject  = "Form completed by " + employeename.rawValue;
    vBody = "The form has been sent by " + employeename.rawValue;
    if  (completedate.rawValue != null || completedate.rawValue != "") {
    vBody   = vBody + " on " + completedate.rawValue;
    if  (EmployeeID.rawValue != null || EmployeeID.rawValue != "") {
    vBody = vBody + " Your ID is: " + EmployeeName.rawValue;
    var oDoc = event.target;
    oDoc.mailDoc({
         bUI: false, 
         cTo: "[email protected]",     cSubject: "Statement from " + EmployeeName.rawValue + "

  • Help required with submit button

    Hi,
    I need a little help with the submit button. The user submits the form as PDf to a servelt using submit button. The form submitted is validated at server side. If there are any errors the error messages are to be displayed to the user as a part of Form.
    My approach was to have a hidden field present in the form. Once the error messages are recieved the field is to be populated with these messages and made visible true.
    Problem with my approach:
    1) How to send back data to the field using the servlet code which we have?

    Unless if you use a Webservice, sending data back to form from the Servlet may not possible.
    Once the form submits the data to the Servlet, the connection will be lost between the form and Servlet.
    But if you use a Webservice, you can trap the response and display it to the user.
    Other alternative to Servlet approach is, display a another page in the browser with the response.
    So the user after submits will be notified of the result in a new window.
    Thanks
    Srini 

  • Spry Validation issue.

    I'm trying to use spry validation to have some informative
    text disappear from a text area when the user clicks on the text
    area. Attached is my code. What am I doing wrong?

    Change the textarea to be empty:
    <textarea name="JobDescription" id="JobDescription"
    cols="45" rows="5"></textarea>
    Then add a hint in the Spry:
    var sprytextarea1 = new
    Spry.Widget.ValidationTextarea("sprytextarea1",
    {validateOn:["blur"], hint:"Please include as much
    information as possible, such as span, pitch, area and area
    of specialty trusses, in addition to any information you believe to
    be
    needed."});
    The above needs to be on one line.
    Ken Ford
    Adobe Community Expert - Dreamweaver/ColdFusion
    Fordwebs, LLC
    http://www.fordwebs.com
    "jgeisler" <[email protected]> wrote in
    message news:[email protected]...
    > I'm trying to use spry validation to have some
    informative text disappear from
    > a text area when the user clicks on the text area.
    Attached is my code. What am
    > I doing wrong?
    >
    > <script src="SpryAssets/SpryValidationTextarea.js"
    > type="text/javascript"></script>
    > <link href="SpryAssets/SpryValidationTextarea.css"
    rel="stylesheet"
    > type="text/css" />
    > </head>
    >
    > <body>
    > <label></label>
    > Name:
    > <label>
    > <input type="text" name="Name" id="Name" />
    > </label>
    > <p>Address:
    > <label>
    > <input name="Address" type="text" id="Address" />
    > </label>
    > </p>
    > <p>City:
    > <label>
    > <input name="City" type="text" id="City" />
    > </label>
    > </p>
    > <p>State:
    > <label>
    > <input name="State" type="text" id="State" />
    > </label>
    > </p>
    > <p>ZIP Code:
    > <label>
    > <input name="ZIP Code" type="text" id="ZIP Code"
    />
    > </label>
    > </p>
    > <p>Phone #:
    > <label>
    > <input name="Phone #" type="text" id="Phone #" />
    > </label>
    > </p>
    > <p>Email:
    > <label>
    > <input type="text" name="Email" id="Email" />
    > </label>
    > </p>
    > <p>Description of Job:</p>
    > <p><span id="sprytextarea1">
    > <label>
    > <textarea name="Job Description" id="Job Description"
    cols="45"
    > rows="5">Please include as much information as
    possible, such as span, pitch,
    > area and area of specialty trusses, in addition to any
    information you believe
    > to be needed.</textarea>
    > </label>
    > <span class="textareaRequiredMsg">A value is
    required.</span></span></p>
    > <p>
    > <label>
    > <input type="submit" name="button" id="button"
    value="Submit" />
    > </label>
    > </p>
    >
    > <script type="text/javascript">
    > <!--
    > var sprytextarea1 = new
    Spry.Widget.ValidationTextarea("sprytextarea1",
    > {validateOn:["blur"]});
    > //-->
    > </script>
    > </body>
    > </html>
    >

  • Custom validation is disabling submit button

    Hi there,
    I am using the update/insert feature within ADDT, but wanted to use my own validation using JavaScript. Everything works fine, the validation pop-up works etc, but the submit button is disabled. I'm guess that the transaction has started with the ADDT, but the javascript has stopped it. How can I get around this? any suggestions welcome...
    Thanks in advance...

    Hi,
    Have you tried different browsers to double check. I remember a couple months ago I was helping someone with a similar problem, it worked in one browser fine but not the other so we had to rewrite the code. Initially the code looked fine but just didnt work in IE.

Maybe you are looking for

  • Why can't I find Adobe Reader on my computer?

    I work for a company with several users and we're having an issue with Adobe Reader. I download Adobe Reader from Adobe.com and it installs like normal and even confirms it's installed. However, I try and find the reader and it is nowhere to be found

  • Visio 2010 Stardard install error on Windows 8.1 with Office Pro 2013 already installed

    Both Visio and Office are 64bit. Visio gives "The language of this installation package is not supported by your system". Tried the LIS "CacheOnly" suggested on a few sites. Causes Installer boot segment fault. Any ideas? Suppose we have to uninstall

  • Diablo 2 crashing after 10.6.8 update

    Diablo 2 has been running fine until I updated to 10.6.8 this afternoon. Now, I can start the game and go through menus, but if I try to start a game (online or single player), it crashes. Here are the details of the crash: Process:         Diablo II

  • Error : IF_WORKFLOW does not exist ?

    Hello, i creaed an abap class using the class builder and i want to use this class in a workflow, once i added the class and its method to the workflow, and i did checking, the system said" IF_WORKFLOW does not exist. i know i can create workflow wit

  • WRT160NL Issue

    WRT160NL doesn's seem to allow N-speed connections. My laptop with Intel 4569AGN only connects at 54Mbps at best. It recognizes the router as 802.11n and states that the connection quality is Excellent. I don't believe I could restrict that adapter t