problem with input

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • qpon

    #1

    problem with input

    I've got:

    function showPrice()
    {
    document.write( "<font color='000000' size=1 face='verdana'> " + name +
    "</font>");
    }

    function showItem()
    {
    document.write( "<font color='000000' size=1 face='verdana'> " + price +
    "</font>");
    }

    value of the 'name' & 'price' are getting from other site, What should I do
    to put those values in <input>?
    I know it should be something with document.form.i .value=... (what should
    goes here?)
    thx for any reply!
    qpon



  • Thomas 'PointedEars' Lahn

    #2
    Re: problem with input

    qpon wrote:
    [color=blue]
    > I've got:
    >
    > function showPrice()
    > {
    > document.write( "<font color='000000' size=1 face='verdana'> " + name +
    > "</font>");
    > }
    >
    > function showItem()
    > {
    > document.write( "<font color='000000' size=1 face='verdana'> " + price +
    > "</font>");
    > }
    >
    > value of the 'name' & 'price' are getting from other site, What should I
    > do to put those values in <input>?[/color]

    Use server-side scripting. Server-side JavaScript 1.2:

    <SERVER>write(' <input ... value="' + request.price + '" ...');</SERVER>

    Server-Side JScript in ASP on IIS, using POST requests:

    <%@ LANGUAGE = JScript %>
    ...
    <input ... value="<%= Request.Form('p rice') %>" ...>

    Using GET requests:

    <input ... value="<%= Request.QuerySt ring('price') %>" ...>
    [color=blue]
    > I know it should be something with document.form.i .value=... (what should
    > goes here?)[/color]

    It should not because your shop won't work without client-side script
    support which is a Bad Thing. However, if, and only if, the other
    site uses GET requests, you can parse location.search , then use

    <script type="text/javascript">
    document.write(
    '<input ... value="'
    + valueObtainedFr omLocationSearc hComponent
    + '" ...>');
    </script>


    PointedEars

    P.S.
    Your "From" header address is a violation of Internet/Usenet standards
    and most likely of the Acceptable Use Policy of your service provider.
    Consider yourself killfiled unless it is changed.

    Comment

    Working...