Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

So I have this code that will change state initials to the full state name. Right now I only have a single state(Illinois) how would

So I have this code that will change state initials to the full state name. Right now I only have a single state(Illinois) how would I be able to switch it to any state abbreviation that the user puts in turns into the full state name, not just Illinois.

stateabbrev.html

State Abbreviations State Abbreviation: function successFunction(data,status) { $("#output").text("State: " + data); } $(document).ready(function() { $("#myForm").on("submit", function() { var myState = $("#state").val(); var myData = "state=" + myState; $.ajax({ type: "POST", url: "statefull.php", dataType: "json", success: successFunction, data: myData }); return false; }); });

statefull.php

$stateAbbrev = trim($_POST['state']); if ($stateAbbrev == "IL") { print json_encode("Illinois"); } ?>

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

App Inventor

Authors: David Wolber, Hal Abelson

1st Edition

1449397484, 9781449397487

More Books

Students also viewed these Programming questions

Question

What is an intranet?

Answered: 1 week ago

Question

What is client/server computing?

Answered: 1 week ago