A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: [MX04] Input Text Field not working with script...

Hybrid View

  1. #1
    Junior Member
    Join Date
    Jan 2007
    Posts
    8

    [MX04] Input Text Field not working with script...

    I have a search script that I've set up that seems to be working great so far: only from the HTML form. Here it is in action:

    http://www.cramcrew.com/search/search.asp

    However, I can't get that text box in the header (which is in flash) to work the same way. I don't know how to take the code from the asp file and make it happen in flash. Here is what is in the asp file:

    <form action="search.asp" method="get" onsubmit="return isSearchTermValid( this );">
    <input type="text" name="searchTerm" size="25" maxlength="35" value="<%=gobj_searchTerm.outputSafeTerm%>">
    <input type="submit" name="Submit" value="Search">
    </form>



    Well, seeing as how I don't really know how to make all of that work in flash, all I have so far in flash is this:

    on (release, keyPress "<Enter>") {
    getURL("http://www.cramcrew.com/search/search.asp", "GET");
    }


    I've tried setting the Var for the input text box to say "searchTerm" and another time "<%=gobj_searchTerm.outputSafeTerm%>" but neither worked. I am at a loss... what am I supposed to do? Thanks!

  2. #2
    Member
    Join Date
    Jul 2005
    Posts
    37
    Hi JW,

    You need to use LoadVars. Here's a small example:

    var my_lv:LoadVars = new LoadVars();
    my_lv.searchTerm = textboxName.text;
    my_lv.send("http://www.cramcrew.com/search/search.asp", "_self", "GET");


    //replace 'textBoxName' with your text box name for search

    regards

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center