Title: Re: [Active4d-dev] Submitting Form with Select Box
This could be a solution for you.
Save the file as "test.a4d"
I hope the code will no wrap via eMail.
Gruss Oliver

<%
C_TEXT($a4dAction)
C_TEXT($otherVal)
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/2000/REC-xhtml1-20000126/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>a4d Test</title>
<script type="text/_javascript_">
    // <![CDATA[
        function loadPage(thePath){
            if(thePath!=""){
                document.forms[0].action="">                 //document.forms[0].target='';
                document.forms[0].submit();
            }
        }
        
        
    // ]]>
    </script>

</head>
<body>

<form method="post" action="" name="Form0" false">

<select name="test" >
<option value="">---</option>
<option value="test.a4d?a4dAction=save&id=xxx&v=xxx">Save</option>
<option value="test.a4d?a4dAction=load&id=xxx&v=xxx">load</option>
<option value="test.a4d?a4dAction=delete&id=xxx&v=xxx">delete</option>
<option value="test.a4d?a4dAction=show&id=xxx&v=xxx">show</option>
<input type="text" size="20" name="otherVal" value="<%=$otherVal%>">
</select>
</form>
<%
case of
    :($a4dAction="save")
        writebr("<h3>Save a Record ...</h3>")
    :($a4dAction="load")
        writebr("<h3>Load a Record ...</h3>")
    :($a4dAction="show")
        writebr("<h3>Show a Record ...</h3>")

end case
dump locals
%>

</body>
</html>


> This is probably more of a _javascript_ type question, but I figured someone
> here knows how to do this.
>
>
>
> Lets say I have 2 form objects, a select list with customer locations, and
> text box that shows the currently selected location’s address.  When a
> different location is selected, I want the address to automatically update
> without having to click on a submit button.  I don’t know _javascript_ or
> VBScript, but from what I’ve gleamed off the web, I need to us the “onchange”
> attribute for the select box to call a function.  Can someone point me to a
> good example and is there a way to make that _javascript_ function call an
> Active 4D method?
>
>
>
> Thanks!
>
> Jason Hect
>

Reply via email to