3

I am trying to make a form submit an address to run a script. I am not familiar with code, but trying to wing it here.

So I have one page with this:

 <form action="rpr.html" method="post">
Enter Address: <input type="text" name="address"><br>
<input type="submit">
<input type="hidden" id="my_address_post" value="<?php echo   $_POST['Address']; ?>">
</form>
</body>
</html>

And then my second page is saved as rpr.html and here's what I have there:

<script type="text/javascript">

  var rprAvmWidgetOptions =
  {
    Token : "222731C6-C794-4BE0-B346-E7AEFF0555E8",
    Query : "address",
    CoBrandCode : "btsremaxontheriver",
    ShowRprLinks : false
  }
  var my_address = 
  document.getElementById('my_address_post').value;
</script>
<script type="text/javascript" src="//www.narrpr.com/widgets/avm-widget/widget.ashx/script"></script>

I got this code generated from a website and cannot figure out how to set it up correctly. I feel like I'm really close, but just not quite there.

1
  • 3
    There is no jQuery here. Commented Feb 28, 2017 at 19:38

2 Answers 2

1

You can use something like that :

$.ajax({
  type: "POST",
  url: url,
  data: rprAvmWidgetOptions 
});

Found on : https://api.jquery.com/jQuery.post/

Sign up to request clarification or add additional context in comments.

Comments

0

Or, if you don't want to use $.ajax() you could just use:

$.post(url, rprAvmWidgetOptions);

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.