Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

70
Views
Submitting a javascript object to vbScript and referencing its properties in classic ASP

I've never passed a JavaScript object to an .asp page. Can someone give me the syntax here. I've tried googling w/o success. The object is called buyerInfo. Using jQuery.

<form id="aform" action="formact.asp" method="POST">
    <input type="hidden" id="myhid" name="myhid" value="">
    <input type="submit">
</form>

<script>
    buyerInfo = {};
    buyerInfo.name = "Joe Buyer"
    buyerInfo.zip = "12345"
    $("#myhid").val(buyerInfo);
</script>

-- and in formact.asp

<%
    Set buyer = Request("myhid")
    name = buyer.name
%>

yields Object doesn't support this property or method: 'buyer.name'.

What is the correct way to reference these? I know the JavaScript object is being passed, but I don't know how to access its pieces. Thanks.

about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

You could get away without using any Classic ASP libraries

jQuery

    $.post('/process.asp', {
        name: buyerInfo.name,
        zip: buyerInfo.zip
    }, function (data) {
    }).done(function (data) {
        alert(data); // Data that is returned by the ASP pae
    });

ASP

dim name : set name = request.form("name")
dim zip: set zip= request.form("zip")
about 4 years ago · Juan Pablo Isaza Report

0

Classic ASP does not have JSON or object's (at least in this sense) built-in by default and you have to load other libraries.

I suggest including this ASP JSON library at the top of formact.asp :

https://github.com/nagaozen/asp-xtreme-evolution/blob/master/lib/axe/classes/Parsers/json2.asp

and then passing the value like this:

<%
    Dim buyer : set buyer = JSON.parse(request.form("myhid"))
    name = buyer.name
%>
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!