mattyd 89 Posting Maven Featured Poster

Thanks, rproffitt

mattyd 89 Posting Maven Featured Poster

I've just started a class to learn automation testing via Selenium.

I'm using Firefox 61.0.2 (64-bit)

I'm noticing a possible bug; not something major, but something that prevents efficiency:

When attempting to load a saved project into the IDE via Open Project or through drag-and-drop, it does not load. Usually this requires closing/reopening the IDE and both methods to open a previous project will then load correctly.

1) My question in reference to this: has anyone experienced this, is it a known bug, and is it a good idea to simply revert to an earlier version of Firefox to remedy this?

2) My other question is in reference to the type of file that the project/case is saved as: the class I'm taking states the test will be saved as HTML when in fact it is saved as a .side file. I do not see options in the version of Selenium to choose file type to save as.

I never heard of a .side file so I googled it; beside finding references to .side, I can find no definition of what sort of file this is. After further research I'm making the assumption ".side" stands for "Selenium IDE" file. Is this correct?

Thanks for any assistance.

mattyd 89 Posting Maven Featured Poster

(Mod: if this is not the appropriate area for this post, please move. Thanks.)

I am attempting to Find and Replace text in an Excel 2016 spreadsheet.

For example, I'm searching for the following URL in the spreadsheet:

https://sample.com/user

Upon located this URL in the spreadsheet, I want to replace the following with the @ symbol:

https://sample.com/

The result would be this:

@user

Previously, I was using Excel online and was able to do this easily. I'm now using a desktop version which is giving me the following error message: "This function is invalid"

When I attempt to make the change manually, it seems to initiate a function; I am not familiar with Excel functions and do not need this at this time.

I've read online that the @ symbol is reserved and related to functions (?) and therefore cannot be used as a simple text symbol-- is this true?

Is there any method (or work-around) to achieve this?

Thank you in advance.

mattyd 89 Posting Maven Featured Poster

Thanks, pty, I will try that now.

One question if I may: as I stated in the earlier post, I am using a free account at this time. I noticed in the account earlier that a free acount "does not grant access to Remote SQL"; I'm unfamiliar with Remote SQL - I've been researching what it is specifically.

Is it different than a standard connection to my database through my test site being hosted by the company, (what I would typically connect to via my laptop, for example,) or is it specifically a sort of permnission to let others (say in a network) to also connect to my DB and edit, etc? Basically, is Remote SQL different than what I've always used when testing a website?

Thanks much for your help.

mattyd 89 Posting Maven Featured Poster

Before I get into the specific issues, I want to provide some other details:

  • Normally, I work on a live, paid server (even in dev); I realize that is not advised, but it is a bad habit I developed over the years. I've tried using Xammp, but do not really care for that environment for various reasons. Recently, I stopped paying for web-hosting (GoDaddy,) and have been developing various scripts on a free host.

  • Overall, free hosting is quite limited, that is, many do not give access to error logs, for example. There are other vital features that are often paid-only.

I came across a new hosting site that seems fairly good for testing my scripts/mark up.

I am attempting to produce a registration form with email verification. My last script for a registration form (without email verifcation) worked perfectly, submitting all data to a database. Never any errors beyond incorrect PHP/MySQLi syntax.

I did not develp the particular code posted here, but am using it to learn how to implement email verification.

At this point, on this new server (and other free servers in the recent days,) I've been receiving errors (that never occurred with paid-hosting.)

Also, should it matter, I believe this current server is MS; I've only really only worked on Linux and it seems different. I'm not sure what the differences are (that the user must do more to set up users/permissions? I never had to do any of that on my …

mattyd 89 Posting Maven Featured Poster

Thank you cereal and pty for your help and recommendations.

I am going to review your info this evening and try implenting some of it later tonight.

Until recently, I did not know ip's were such a complex topic; I do not mean merely storing them correctly, but the entire scope. I've been reading some other material this evening such as this document. It is a lot to learn but very important. It's fascinating!

I will return here soon with any questions I may have in regards to storing ip's.

Thanks again.

mattyd 89 Posting Maven Featured Poster

Thank you for your assistance, cereal. I appreciate it.

mattyd 89 Posting Maven Featured Poster

I've been reseraching the best way(s) to store both ipv4 & ipv6 ip addresses.

Simply put, so far there seems to be much debate as to how to do so properly ranging from storing them as varchar or in a binary format.

I'm really not sure at this point.

I suppose I would like to hear from some folks here as to your experience doing so.

Some things I need to consider:

  1. At some point, I may be storing possibly millions of ips, so I do need to consider storage size in advance, obviously.

  2. I also assume when I capture ips, I would have to store each type in a seperate row, or can one store both types together then sort them at a later time? I'm sorry, I'm not sure if that question makes sense.

Can both types be caputured in the same manner and treated in a similar manner until I have to actually present them in a readable format to someone in the future? (At this point, I'm not concerned how they appear when stored, as long as they can be dealt with later in a human-readable manner.)

I'm also learning about inet_ntop(), inet_pton() from this site and think this may be somehow related to what I'm inquiring about.

Any hint or push in the right direction would be highly appreciated; a link to an apporiate article/thread/site, etc.

Thank you in advance for your time.

mattyd 89 Posting Maven Featured Poster

I have recently been using XAMPP for dev. Although I'm new to XAMPP, the recent issue sprung up surprisingly, the simple script running a day before.

The script is just being used to test the ability to capture/display an IP address; this will later be used in a larger project:

<!DOCTYPE html>
<html>
<body>
<h2>THIS IS A PHP PAGE (with HTML)</h2>
<?php
echo $_SERVER['SERVER_ADDR'];
?>
</body>
</html>

As I stated, it worked the other day, displaying ::1 on my local machine; I loaded the same script to an online, test server and it worked there correctly, returning my ipv4 address.

The issue is that now, when I run the same script again locally, nothing displays (besides the HTML message); researching this, I read that if the mark-up is displaying locally but not the PHP, the PHP is not running. I'm not sure why that would be the case; XAMPP is running. The machine had been rebooted (This local machine is quite old and has various problems from time to time, so I'm not ruling out that it may be the machine itself.)

*On another note, I am still not clear on how to implement the >_inline Code feature here - I've never seen this on any other site and it never seems to work correctly for me, thus making the process of posting a question/code more of a hassle than an asset - please explain. Thanks

Any advice would be greatly …

mattyd 89 Posting Maven Featured Poster

I installed Watir yesterday.

The docs seem a bit unclear as to what gems are exactly needed to get this to work.

I used this a number of years ago at a QA job. All testing we did was manual (at that point) and we used Ruby/Watir to essentially simplify a few set-up steps for our tests. It worked wonderful.

Thank you for your help. I appreciate it.

mattyd 89 Posting Maven Featured Poster

I used rubyinstaller 2.2.6 > https://rubyinstaller.org/

My OS is Win7/ 64

mattyd 89 Posting Maven Featured Poster

rproffitt

Thank you for your reply.

Research method entailed reading Ruby docs, searching for info regarding the error message, Ruby groups, etc.

All the info I found was quite vague.

mattyd 89 Posting Maven Featured Poster

I am attempting to properly install and run a Ruby script.

I have not worked in Ruby for some time and am not sure what I'm missing; it worked perfectly in the past (on a work machine.)

I am receiving the following error message:

<Main> undefined local variable or method ''watir'' for main: Object <NameError>

I have reserached this, but am unable to determine what is causing this error.

Version: ruby 2.2.6p396

Script:
`

require ‘watir’ 
require ‘watir-webdriver’
Watir::Browser.default = “firefox” 
browser = Watir::Browser.start  "https://www.website.com"
browser.link(:text, "Register").click
browser.button(:value,"I Agree").click
browser.button(:value,"I Agree").click
browser.text_field(:id, "username").set("bbb")
browser.text_field(:id, "password").set("bbb")
browser.text_field(:id, "password2").set("ccc")
browser.text_field(:id, "email").set("hhh")
browser.text_field(:id, "email2").set("yyy")
browser.checkbox(:name, "imagestring").set
browser.checkbox(:id, "emailpmnotify").set
browser.checkbox(:id, "invisible").set
browser.select_list(:id, "subscriptionmethod").select("No email notification")
browser.select_list(:id, "timezoneoffset").select("GMT -3:30 (06:27 PM)")
browser.select_list(:name, "dstcorrection").select("Never use DST correction")
browser.select_list(:id, "language").select("English (American)")
browser.button(:value,"Submit Registration!").click

`

Thank you in advance

mattyd 89 Posting Maven Featured Poster

Thanks for your help, Dani.

mattyd 89 Posting Maven Featured Poster

I want to collect basic user information when they land on an index page, such as:

IP
Country
City
State
Zip Code

I've looked into sites such as ipinfo.io that offer a service regarding these details, but think it may be easier to collect the same info via PHP. From some sample PHP code I've looked at, it seems easy and possible.

My question is what would generally be a better option: PHP or using a service (the service limits the amount of hits processed per day, 10,000, so that is a consideration)?

I am just looking for advice on this at this point, the best options to consider, and possible issues regarding this before I attempt to implement this.

Thanks in advance!

mattyd 89 Posting Maven Featured Poster

Part of this seems to be a Chrome issue.

I created a simple favicon, uploaded to the server, and added it to the page in question; it will not update in Chrome (still shows the Github favicon.) It actually displays the new favicon in IE (and FF,) which surprised me as I never use IE, save for browser testing. Chrome dissapoints me sometimes :(

mattyd 89 Posting Maven Featured Poster

Question about cached pages, browser:

This page I'm working with is .php

I am now seeing (reviewing cached pages in Chrome, cookies, etc) that .php pages do so seem to be saved. I never knew that. Is this true?

If this is the case, is there a way to flush .php pages from browser memory, if they are being stored somewhere?

Thanks!

mattyd 89 Posting Maven Featured Poster

Dani,

Yes, that may be it.

The other odd behavior with that code from Github: I was experimenting with captcha scripts. I added one from Github. After I configured it and ran it (on a registration form,) it returned and loaded the Github homepage. I thought "Why is that happening and allowed to happen with someone's code hosted on Github? Is this captcha code altered to do this?"

I reviewed that captcha code: no links to Github or anything like that.

It's all a bit of a mystery at this point. But, I will always hesitate with Github now and will not waste my dev time trying to figure out what they're up to.

Thank you for your reply. I appreciate it :)

mattyd 89 Posting Maven Featured Poster

An odd thing I've never seen or had occur in all the years of web dev:

The other day I got some code from Git-Hub and added it to my index page.

I decided not to use the code and removed it.

I then noticed that the Git-Hub favicon image is being displayed in my Chrome tab for this dev page.

How could this possibly happen? There is no code for this in the page and that icon is not on my server (I have never added any favicon for this project.)

The only thing I can possibly think of is that it's some kind of memory issue in my machine (but that makes no sense either.)

Has anyone ever seen something like this? It's not a huge issue, it's just a cloned, dev page; I would like to understand why it's happening, though.

Thank you in advance!

mattyd 89 Posting Maven Featured Poster

I am attempting to transfer all content from a Win10 machine to a Win7 machine. They are connected via a cable.

I go through the steps to allow them to recognize one another; I transfer one, small text file to test it.

On the Win7 machine, the other machine (Win10) seems to be displayed, but, as a media device only able to be opened via Windows Media Player. Why is this? When I attempt to open the text file it says I "need access" (?)

I may be doing something wrong.

Any help in general with this is appreciated.

Thanks!

mattyd 89 Posting Maven Featured Poster

@hielo

I followed your suggestion:

var path = '/images/';
should be
var path = '/';

That worked instantly to fully, correctly display the 1st button. That is, what I referred to above, that I got the 2nd & 3rd button working but not the first button at all, today.

So, altering the path variable to '/': Why did it work now, when before the 2nd & 3rd button were displaying/swapping, but the 1st was not? All buttons function properly now.

Thanks for your help.
-Matthew

mattyd 89 Posting Maven Featured Poster

Well, I got (part) of it working. The 2nd and 3rd button in the js array are displaying and swapping images properly. The 1st image is not displaying at all.

That's okay for the moment.

mattyd 89 Posting Maven Featured Poster

The file structure at this point is basic:

-Project folder: html file, "images" folder, js/jQuery, css files (in seperate folder)

-Rig: I'm running this locally on a laptop (previously most builds were on live server; this worked on previous builds great, but does not now)

I fear I am making a very simple mistake involving the file structure. I fear working late at night and make changes does not help.

One issue I have is that I need a piece of versioning software were I can do auto-save of ALL code, versionied, every 5-Minutes. Depending on my own versioning methods is not proving to work well and is a mess.

mattyd 89 Posting Maven Featured Poster

At this point I am bit confused.

I have a simple, local file structure.

Changes I make just now to the path in the code still displays broken images.

I am not sure why this worked 2-weeks ago but is breaking now.

I still find aspects of the OO a bit complex (for what is actually being done, swapping images);

I admit I do not exacly understand it.

mattyd 89 Posting Maven Featured Poster

@ rproffitt

Yes, that may it. No, there are not two "image" folders; this is something I noticed late last night as an obvious issue. It was too late to start changing the code; it breaks and I wake up forgetting the changes.

Actually, the two "images" folder was a mistake, an issue from about 2-weeks ago I had dealt with. This was one of those stupid errors I previously made, fixed and am now dealing with again.

(I really do try to store back-ups of working code on a daily basis locally and to the cloud. Problem is: my OCD behavior with code back-up is actually not as organized as I think and I always go back to wrong saves. I save everything - even broken code. lol. I think I need a new system for storing builds.)

I will look into your suggestion now and repost layer.

Thank you kindly for your help. :)

-Matthew

mattyd 89 Posting Maven Featured Poster

I am currently working on using Javascript arrays to swap images for rollover buttons.

This was working perfectly for one build about a week ago. That is, I am working on something else now and tried to use the same code that worked for this - it's broken now;

-A difference is that I am building this new dev locally. It is not on a live server yet. That really should not matter-- right?

-A broken image icon is displayed. There seems to be a roll-over effect occuring, though. This indicates to me that the path to the image is not linked correctly, something rather simple yet I can't seem to fix it.

I find some of the OO aspects a bit confusing: It seems that an image is turned into an object simply to be able to process it from within an array, programatically. But, HTML is needed to call the actual image for display. I guess I am confused as to why an image must be turned into an object. This I need to understand.

But, I am trying understand this fully, not just hack away at code/mark-up.

Thank you in advance for any points in the right direction(s).

`Inline Code Example Here

<head>
<!--js button swap code part 1--> 
<script type="text/javascript">
<!--
if(document.images)
{
  var image_array = new Array();

  // path to the directory with images
  var path = '/images/';

  // enumeration of the "active" images
  image_array[0] = path + "images/black_menu2.jpg";
  image_array[1] = path + "images/black_history2.jpg";
  image_array[2] …
mattyd 89 Posting Maven Featured Poster

I am working on developing a simple site, optimizing for mobile.

I am using jQuery at this time to render basic, rollover buttons using image-swapping.

The issue I am having involves using multiple, different buttons; for example, 3 buttons, different images for each (one "on" image, one "off" image for each button; 6 total images)

I am a bit confused at this point as to what is exactly happening. Is the code correct? I have researched various tutorials today but found that each is suggesting various methods to do this.

I will paste/mark-up if anyone can explain this to me, or, how these seperate buttons should be written as to allow for proper operation, live.

Thanks

`

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.2/jquery.min.js"></script>

<script type="text/javascript">
$(document).ready(function() {
$("img.rollover").hover( 
function() { this.src = this.src.replace("_off", "_on"); 
}, 
function() { this.src = this.src.replace("_on", "_off"); 
});
}); 
</script>

    <link rel="stylesheet" type="text/css" href="style.css" />
    <!--[if lt IE 7]>
        <link rel="stylesheet" type="text/css" href="style-ie.css" />
    <![endif]-->
</head>
<body>

<div id="left-sidebar">
       <a href="#"><img src="images/blackMenu_on.jpg" class="rollover" /></a> 
       <br />
       <a href="#"><img src="images/blackHistory_on.jpg" class="rollover" /></a>

`

mattyd 89 Posting Maven Featured Poster

@ gentlemedia,

When I look at the site on my smart-phone I do not have a horizontal bar. Rendering on a small device such as this is one of my main concerns in development

Yes, I thought that the banner image may be dictating the size of the header area which I felt instinctually was not the correct way to go

I am going to research responsive design and learn more about it today

Thank you for your assistance and suggestions. Much appreciated

I may post back here later with more questions

-Matthew

mattyd 89 Posting Maven Featured Poster

@ gentlemedia

Thank you for your reply.

Can you elaborate a bit more if possible?

The thing about this mark-up is that after testing it a bit it seems to perform as described, that is, is deals excellent with the mobile devices.

I need to learn though how it is all working.

This template seems very light compared to the majority of HTML+CSS I have worked with.

I would like to understand how to alter the height of the header area in this case. I am not seeing how to do that in this example.

Thanks,
Matthew

mattyd 89 Posting Maven Featured Poster
mattyd 89 Posting Maven Featured Poster

I am using a template to learn more about fluid design

My main confusion at this point regards how structure and size is defined.

For example in the CSS, there is a header tag; but the actual area of the header/banner is not defined. Or is it? I cannot figure out how this is occurring.

The mark-up seems quite simple.

Please see HTML and CCS below

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />

    <title>The Perfect Fluid Width Layout</title>

    <link rel="stylesheet" type="text/css" href="style.css" />
    <!--[if lt IE 7]>
        <link rel="stylesheet" type="text/css" href="style-ie.css" />
    <![endif]-->
</head>

<body>

    <div id="page-wrap">
        <div id="inside">

            <div id="header">
                <a href="http://css-tricks.com"><img src="images/perfectfluidwidthheader.gif" alt="header" /></a>
            </div>

            <div id="left-sidebar">
                <p>Ii putamus mutationem wisi laoreet eros. Quinta processus saepius facer consequat fiant. Adipiscing ea possim vulputate quarta quam. Molestie dolor sed suscipit quis qui. Et feugait claritatem soluta est duis. Mutationem augue typi dynamicus dolore placerat. Lius typi dynamicus gothica per futurum.</p>

            </div>

            <div id="main-content">

                <h2>Why is this layout "perfect"?</h2>
                <ul>
                    <li>Works in all major browsers</li>
                    <li><strong>Shrinks</strong> to 780px<br />This accomodates users with 800x600 resolution, with no horizontal scroll!</li>
                    <li><strong>Grows</strong> to 1260px<br />This accomodates users with 1280x768 resolution and everything in between.</li>
                    <li>This accomodates 90%+ of all internet users. You could easily make this layout grow larger, but be mindful of how line-length affects readability. Nobody wants to read a line of text 1980px long.</li>
                    <li>The left sidebar is of "equal height" to the …
mattyd 89 Posting Maven Featured Poster

@ LaxLoafer,

Why do I not attempt a registry edit even if is "trivial" as you say? I am not comfortable doing so, possibly ending up permanently locked-out of my laptop should something be done incorrectly. That is not trivial at all.

Also, you made a statement, above ^: "With a bit of luck"

Luck? Is that how you program or fix a machine? No, I will wait for more sound advice.

mattyd 89 Posting Maven Featured Poster

Thank you for the help and info, LaxLoafer.

But, as I learned in school for software: "Never mess with the registery unless you are totally sure what you are doing." In my case, I am not familiar enough with the registry to attempt such changes.

Also, and this is simply directed at Microsoft: Why in the world would they make such a simple feature (changing a user name) unavilable when up until a few months ago you could do it via Control Panel > User Accounts? Thanks for the non-stop updates, MS. :/

mattyd 89 Posting Maven Featured Poster

Hello,

To begin, I am a registered member but have not been here in awhile - I have misplaced my login credentials and must post anonymously.

I recently purchased a new laptop and am cleaning up my old one and giving it to a friend. This older laptop runs Windows 10.

The issue seems simple but I have researched it and cannot get the change(s) to take.

When the machine boots to the login screen it has been showing my name and picture; I am trying to alter it to show HER name and picture. The picture part works. I cannot get the name change, though.

I attempted the following:

  1. I created a new admin account for her (at the moment I am also still an admin on the old machine)
  2. I created a new online Microsft account for her; new email, etc. The name, online in the Microsoft account is her name, but when I reboot it still displays my name.
  3. I have have tried various changes last night on the old machine (I cannot remember them all now). Although many online tutorials claim that one may change the usename via the machine settings on Win10, this no longer seems to be the case; I suppose this has to do with updates, system changes and that those videos are out-dated.

Simply put, I just want her name and picture to display when the old machine boots, not mine.

Note: I have both she and I set as admins …

mattyd 89 Posting Maven Featured Poster

Hello.

A section of what I am developing for my site requires the User to select an avatar for their account.

1)Instead of using visible radio buttons I have decided to allow the actual avatar image to act as the radio button for selection.

I am receiving various results based upon the browser being used, different renderings and functionalities. (Please see attached screenshot for each browser)

radioButtons.jpg

I need to learn how to fix this and make it consistent across all browsers.

Also, This link is to a JSFIDDLE example which I have been using to learn how to proceed with the radio buttons as images. This is the exact HTML/CSS I am using in the example images, above. http://jsfiddle.net/La8wQ/10/

2)After a User chooses an avatar for their account and selects the "Submit" button on the same page, a new page needs to load displaying the avatar; I am confused as to what method to use to do this and also - Should I be storing the avatar images in a folder on the server to have the images selected from or should I be storing them in a database on my hosting site and use PHP/MySQLi to implement this?

Thank you in advance for any help!
Matty

mattyd 89 Posting Maven Featured Poster

Hello.

I am working on a form with multiple text-entry boxes and I am using jQuery to give messages to the User for each field.

So far every field works correctly except for the last field, "Company": When a User enters any text the message should disappear, behaving like the other fields do but it does not.

Snippet of script being used, below:

`

<!--Rules & Messages-->

<script src='jquery.validate.min.js'></script>    
        <script>
            $("#DemoForm").validate({
                rules: {
                    'username': {
                        required: true
                        },
                    'email': {
                        required: true,
                        email: true,
                        },
                    'password': {
                        required: true,
                        minlength: 6,
                        maxlength: 10,
                        },
                    'cfmPassword': {
                        equalTo: "#password",
                        minlength: 6,
                        maxlength: 10,
                        },
                     'city': {
                        required: true
                        }, 
                     'zip': {
                        required: true
                        },
                     'company': {
                        required: true
                        },  
                    },

                messages: {
                    'username': {
                        required:'Please enter a username.'
                        },
                    'email': {
                        required:'Please enter your email.',
                        email:'Please enter a valid email.'
                        },
                    'password': {
                        required:"A password is required."
                        },
                    'city': {
                        required:"Please enter your city."
                        },
                    'zip': {
                        required:"Please enter your zip code."
                        },   
                    'company': {
                        required:"Please enter the company you work/worked for."
                        }   
                    }
            });
</script>

Thank you in advance!

mattyd 89 Posting Maven Featured Poster

This code is an example of what I am using for each textbox (I have about 10 textboxes on the page and want to consolidate it somehow)

`

Username:<br />
<input type="text" id="user_input" name="username" style="width:196px;     margin-bottom: 10px; background-color: #414141; color: #FFFFFF;"/><br>

`

mattyd 89 Posting Maven Featured Poster

Textboxes: I am styling textboxes on my registration form/ index page using CSS.

At this time, it is all in-line CSS; I would like to convert that at some point to an external style sheet and I assume I should use something such as a class to style ALL of the textboxes on the page exactly the same (Instead of including in-line CSS for each textbox, seperately).

mattyd 89 Posting Maven Featured Poster

Hello.

I am currently attempting to convert my inline-css for text boxes into classes for my external style sheet; I thought of using class selectors but do not fully understand some aspects of them.

An example I found online:
`

<!DOCTYPE html>
<html>
<head>
<style>
.center {
    text-align: center;
    color: red;
}
</style>
</head>
<body>

<h1 class="center">Red and center-aligned heading</h1>
<p class="center">Red and center-aligned paragraph.</p> 

</body>
</html>

`

After creating the class (In this case, .center), it is applied as this:

  • h1
  • p

I need to apply the class to textboxes at this point. Is that possible using a class? Can anything precede the "class" such as "textbox class=", for example?

Thank you in advance!
Matthew

mattyd 89 Posting Maven Featured Poster

cereal:

I think that worked perfectly + I have learned a lot from the help you have given me which is very important. I appreciate it!

-Matthew

cereal commented: You're welcome! +13
mattyd 89 Posting Maven Featured Poster

OK, rereading your last reply, I think I understand better now just what you meant. Thanks again.

mattyd 89 Posting Maven Featured Poster

cereal:

In your last post you stated "Set only one for this ID." - I am confused by this. I will eventually have at least seven fields to validate on the one form. How can I go about doing that using jQuery validation?

mattyd 89 Posting Maven Featured Poster

cereal:

I will try this all right now.

Thank you for such a quick response and for your help!

mattyd 89 Posting Maven Featured Poster

cereal:

Hi. I have updated the code per your suggestions but am running into other problems now.

The form can be submitted with no fields filled and the validation for the password/confirm does not work at all (The email validation still works fine). These behaviors were not happening before.

I am running this on a local Apache, otherwise you could see the behavior for yourself - I do not have it up on the hosted server yet.

Thank you for your help.

The new code is below:

`

<!DOCTYPE html>
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<title>jQuery Form Validation</title>

</head>
<body>
<form method = "post" action = "jTest5.8.html" id = "DemoForm" name = "DemoForm">
    Username<br />
    <input type="text" id="user_input" name="username" /><br>
    Email<br />
    <input type="text" id="email" name="email" /><br>       
    Password<br />
    <input type="password" class="form-control" name="password" id="password"/><br>
    Password Again<br />
    <input type="password" class="form-control" name="cfmPassword" id="cfmPassword" /><br>

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

<!--Rules & Messages-->

<!--Username-->

<!--Email-->
      <script src = 'jquery.validate.min.js'></script>    
      <script>
         $("#DemoForm").validate ({
            rules: {
                        'email': {
                                    required:'true',
                                    email: 'true',
                                    }
                      },
                      messages:{
                           'email':{
                           required:'Please submit your email.',
                           email:'Enter a valid email.',
                                       }
                                       },
                                   });
       </script>  


  <!--Password--> 
       <script>
 $("#DemoForm").validate({
           rules: {
               password: { 
                 required: true,
                    minlength: 6,
                    maxlength: 10,

               } , 

                   cfmPassword: { 
                    equalTo: "#password",
                     minlength: 6,
                     maxlength: 10
               }


           },
     messages:{
         password: { 
                 required:"The password is required"

               }
     }

       });
       </script>


</body>

</html>

`

mattyd 89 Posting Maven Featured Poster

The code for the posted question:

`

<!DOCTYPE html>
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<title>jQuery Form Validation</title>

</head>
<body>
<form id="DemoForm"
<form method = 'post' action = 'jTest1.8.html' id = 'DemoForm' name = 'DemoForm'>
    Username<br />
    <input type="text" id="user_input" name="username" /><br>
    Email<br />
    <input type="text" id="email" name="email" /><br>       
</form>
<div id="test">
</div>
 <form id="formCheckPassword">
     Password<br />
     <input type="password" class="form-control" name="password" id="password"/><br>
     Password Again<br />
     <input type="password" class="form-control" name="cfmPassword" id="cfmPassword" /><br>
    <input type="submit" value="submit"/>
 </form>   
<!--Script to disable Submit button --> 

<!--Rules & Messages-->

<!--Username-->

<!--Email-->
      <script src = 'jquery.validate.min.js'></script>    
      <script>
         $('#DemoForm').validate ({
            rules: {
                        'email': {
                                    required:'true',
                                    email: 'true',
                                    }
                      },
                      messages:{
                           'email':{
                           required:'Please submit your email.',
                           email:'Enter a valid email.',
                                       }
                                       },


                                                   });
      </script>

      <script>
      $("#formCheckPassword").validate({
           rules: {
               password: { 
                 required: true,
                    minlength: 6,
                    maxlength: 10,

               } , 

                   cfmPassword: { 
                    equalTo: "#password",
                     minlength: 6,
                     maxlength: 10
               }


           },
     messages:{
         password: { 
                 required:"the password is required"

               }
     }

       }); 
      </script>
</body>

</html>

`

mattyd 89 Posting Maven Featured Poster

Actually, I am already using POST, not GET.

mattyd 89 Posting Maven Featured Poster

When I submit a form and the page refreshes the password and password confirmation values are being displayed in the address bar.

Why is this?

Can anyone explain this and give me an idea how to suppress this behavior?

Please see attached screenshot.

Thank you in advance!

pass12.jpg

mattyd 89 Posting Maven Featured Poster

Problems resolved for now (I think).

mattyd 89 Posting Maven Featured Poster

UPDATE: It now appears to be submitting, but the validation for the password fields do not throw errors when incorrect. Very confused.

mattyd 89 Posting Maven Featured Poster

Hello.

This is probably something very simple that I am missing (Or something that I have done wrong), but upon filling in and validating all fields of the form and pressing the "Register" button nothing happens; Usually the page would reload as if the form had been submitted.

The code is below. Thank you in advance.

`

<!DOCTYPE html>
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<title>jQuery Form Validation</title>

</head>
<body>
<form id="DemoForm"
<form method = 'post' action = 'jTest1.8.html' id = 'DemoForm' name = 'DemoForm'>
    Username<br />
    <input type="text" id="user_input" name="username" /><br>
    Email<br />
    <input type="text" id="email" name="email" /><br>       
</form>
<div id="test">
</div>

<!--Rules & Messages-->

<!--Username-->

<!--Email-->
      <script src = 'jquery.validate.min.js'></script>    
      <script>
         $('#DemoForm').validate ({
            rules: {
                        'email': {
                                    required:'true',
                                    email: 'true',
                                    }
                      },
                      messages:{
                           'email':{
                           required:'Please submit your email.',
                           email:'Enter a valid email.',
                                       }
                                       },


                                                   });
      </script>


</body>

</html>

<!--Password Validation-->
<script src = 'jquery.validate.min.js'></script>
<form id="DemoForm">
<form method = 'post' action = 'jTest1.8.html' id = 'DemoForm' name = 'DemoForm'>
<label for="password">Password</label><br>
<input id="password" name="password" />
<br/>
<label for="password_again">Again</label><br>
<input class="left" id="password_again" name="password_again" />
<br>

<input type="submit" id="register" value="Register" />
</form>
<script src="http://code.jquery.com/jquery-1.11.1.min.js"></script>
<script src="http://jqueryvalidation.org/files/dist/jquery.validate.min.js"></script>
<script src="http://jqueryvalidation.org/files/dist/additional-methods.min.js"></script>
<script>
// just for the demos, avoids form submit
jQuery.validator.setDefaults({
  debug: true,
  success: "valid"
});
$( "#myform" ).validate({
  rules: {
    password: "required",
    password_again: {
      equalTo: "#password"
    }
  }
});
</script>

`