Jump to content

UniURLFrame problam in ajax connect


SayeyeZohor

Recommended Posts

<!DOCTYPE html>
<html lang='fa'>

<head>
    <meta http-equiv='Content-Type' content='text/html' charset='UTF-8'>
    <!-- برای کاراکترهای فارسی مورد استفاده می شود charset متاتگ -->
    <meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0'>
    <!-- این متاتگ برای ریسپانسیو کردن وب سایت لازم است -->
    <meta name='apple-mobile-web-app-capable' content='yes'>

    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css">
    <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js"></script>
    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js"></script>

    <title>Document</title>
</head>

<body dir="rtl">

    <div class="d-flex flex-column flex-md-row align-items-center p-3 px-md-4 mb-3 bg-white border-bottom box-shadow">
        <h5 class="my-0 mr-md-auto font-weight-normal">Company name</h5>
        <nav class="my-2 my-md-0 mr-md-3">
            <a class="p-2 text-dark" href="#" onclick="ajaxRequest(MainForm.UniURLFrame1, 'Teste', []);">Features</a>
            <a class="p-2 text-dark" href="#">Enterprise</a>
            <a class="p-2 text-dark" href="#">Support</a>
            <a class="p-2 text-dark" href="#">Pricing</a>
        </nav>
        <a class="btn btn-outline-primary" href="#" id="a1">Sign up</a>
    </div>

    <div class="pricing-header px-3 py-3 pt-md-5 pb-md-4 mx-auto text-center">
        <h1 class="display-4">Pricing</h1>
        <p class="lead">Quickly build an effective pricing table for your potential customers with this Bootstrap
            example. It's built with default Bootstrap components and utilities with little customization.</p>
    </div>

    <div class="container">
        <div class="card-deck mb-3 text-center">
            <div class="card mb-4 box-shadow">
                <div class="card-header">
                    <h4 class="my-0 font-weight-normal">Free</h4>
                </div>
                <div class="card-body">
                    <h1 class="card-title pricing-card-title">$0 <small class="text-muted">/ mo</small></h1>
                    <ul class="list-unstyled mt-3 mb-4">
                        <li>10 users included</li>
                        <li>2 GB of storage</li>
                        <li>Email support</li>
                        <li>Help center access</li>
                    </ul>
                    <button type="button" class="btn btn-lg btn-block btn-outline-primary">Sign up for free</button>
                </div>
            </div>
            <div class="card mb-4 box-shadow">
                <div class="card-header">
                    <h4 class="my-0 font-weight-normal">Pro</h4>
                </div>
                <div class="card-body">
                    <h1 class="card-title pricing-card-title">$15 <small class="text-muted">/ mo</small></h1>
                    <ul class="list-unstyled mt-3 mb-4">
                        <li>20 users included</li>
                        <li>10 GB of storage</li>
                        <li>Priority email support</li>
                        <li>Help center access</li>
                    </ul>
                    <button type="button" class="btn btn-lg btn-block btn-primary">Get started</button>
                </div>
            </div>
            <div class="card mb-4 box-shadow">
                <div class="card-header">
                    <h4 class="my-0 font-weight-normal">Enterprise</h4>
                </div>
                <div class="card-body">
                    <h1 class="card-title pricing-card-title">$29 <small class="text-muted">/ mo</small></h1>
                    <ul class="list-unstyled mt-3 mb-4">
                        <li>30 users included</li>
                        <li>15 GB of storage</li>
                        <li>Phone and email support</li>
                        <li>Help center access</li>
                    </ul>
                    <button type="button" class="btn btn-lg btn-block btn-primary">Contact us</button>
                </div>
            </div>
        </div>

        <form>
            <div class="form-group">
                <label for="exampleInputEmail1">Email address</label>
                <input type="email" class="form-control" id="email1" aria-describedby="emailHelp"
                    placeholder="Enter email">
                <small id="emailHelp" class="form-text text-muted">We'll never share your email with anyone
                    else.</small>
            </div>
            <div class="form-group">
                <label for="exampleInputPassword1">Password</label>
                <input type="password" class="form-control" id="exampleInputPassword1" placeholder="Password">
            </div>
            <div class="form-check">
                <input type="checkbox" class="form-check-input" id="exampleCheck1">
                <label class="form-check-label" for="exampleCheck1">Check me out</label>
            </div>
            <button type="button" class="btn btn-primary"
                onclick="ajaxRequest(MainForm.UniURLFrame1, 'button1', ['param0=email']);">Submit</button>
        </form>



        <footer class="pt-4 my-md-5 pt-md-5 border-top">
            <div class="row">
                <div class="col-12 col-md">
                    <img class="mb-2" src="https://getbootstrap.com/assets/brand/bootstrap-solid.svg" alt="" width="24"
                        height="24">
                    <small class="d-block mb-3 text-muted">&copy; 2017-2018</small>
                </div>
                <div class="col-6 col-md">
                    <h5>Features</h5>
                    <ul class="list-unstyled text-small">
                        <li><a class="text-muted" href="#">Cool stuff</a></li>
                        <li><a class="text-muted" href="#">Random feature</a></li>
                        <li><a class="text-muted" href="#">Team feature</a></li>
                        <li><a class="text-muted" href="#">Stuff for developers</a></li>
                        <li><a class="text-muted" href="#">Another one</a></li>
                        <li><a class="text-muted" href="#">Last time</a></li>
                    </ul>
                </div>
                <div class="col-6 col-md">
                    <h5>Resources</h5>
                    <ul class="list-unstyled text-small">
                        <li><a class="text-muted" href="#">Resource</a></li>
                        <li><a class="text-muted" href="#">Resource name</a></li>
                        <li><a class="text-muted" href="#">Another resource</a></li>
                        <li><a class="text-muted" href="#">Final resource</a></li>
                    </ul>
                </div>
                <div class="col-6 col-md">
                    <h5>About</h5>
                    <ul class="list-unstyled text-small">
                        <li><a class="text-muted" href="#">Team</a></li>
                        <li><a class="text-muted" href="#">Locations</a></li>
                        <li><a class="text-muted" href="#">Privacy</a></li>
                        <li><a class="text-muted" href="#">Terms</a></li>
                    </ul>
                </div>
            </div>
        </footer>
    </div>






</body>




</html>

 

 

 

            <button type="button" class="btn btn-primary"
                onclick="ajaxRequest(MainForm.UniURLFrame1, 'button1', ['param0=email']);">Submit</button>

for ajax submit call

 

@Sherzod

Link to comment
Share on other sites

procedure TMainForm.UniHTMLFrame1AjaxEvent(Sender: TComponent; EventName: string; Params: TUniStrings);
begin
  if EventName = 'Teste' then
  begin
    Showmessage('oi');
  end
  else if EventName = 'button1' then
  begin
    if Params['param0'].Value.Contains('email') then
      //UniSession.JSCode('MainForm.UniEdit1.setValue(document.getElementById("email1").value);');
      UniEdit1.JSInterface.JSCode(#1'.setValue('+ UniURLFrame1.JSName +'.iframe.contentDocument.getElementById("email1").value);');
  end
end;

 

Link to comment
Share on other sites

25 minutes ago, Sherzod said:

procedure TMainForm.UniHTMLFrame1AjaxEvent(Sender: TComponent; EventName: string; Params: TUniStrings);
begin
  if EventName = 'Teste' then
  begin
    Showmessage('oi');
  end
  else if EventName = 'button1' then
  begin
    if Params['param0'].Value.Contains('email') then
      //UniSession.JSCode('MainForm.UniEdit1.setValue(document.getElementById("email1").value);');
      UniEdit1.JSInterface.JSCode(#1'.setValue('+ UniURLFrame1.JSName +'.iframe.contentDocument.getElementById("email1").value);');
  end
end;

 

i will check that

thanks...

Link to comment
Share on other sites

40 minutes ago, Sherzod said:

procedure TMainForm.UniHTMLFrame1AjaxEvent(Sender: TComponent; EventName: string; Params: TUniStrings);
begin
  if EventName = 'Teste' then
  begin
    Showmessage('oi');
  end
  else if EventName = 'button1' then
  begin
    if Params['param0'].Value.Contains('email') then
      //UniSession.JSCode('MainForm.UniEdit1.setValue(document.getElementById("email1").value);');
      UniEdit1.JSInterface.JSCode(#1'.setValue('+ UniURLFrame1.JSName +'.iframe.contentDocument.getElementById("email1").value);');
  end
end;

 

not work...

please check the simple source code and fix that in the same source code ... thanks

 

http://s13.picofile.com/file/8397699700/WorknotCorrectly1.rar.html

@Sherzod

Link to comment
Share on other sites

40 minutes ago, SayeyeZohor said:

please check the simple source code and fix that in the same source code

Here is what I changed...

01- default.html:

On 5/19/2020 at 12:20 AM, Sherzod said:

window.parent.ajaxRequest...

window.parent.MainForm.UniURLFrame1...

 

OnAjaxEvent:

1 hour ago, Sherzod said:

procedure TMainForm.UniHTMLFrame1AjaxEvent(Sender: TComponent; EventName: string; Params: TUniStrings); begin if EventName = 'Teste' then begin Showmessage('oi'); end else if EventName = 'button1' then begin if Params['param0'].Value.Contains('email') then //UniSession.JSCode('MainForm.UniEdit1.setValue(document.getElementById("email1").value);'); UniEdit1.JSInterface.JSCode(#1'.setValue('+ UniURLFrame1.JSName +'.iframe.contentDocument.getElementById("email1").value);'); end end;

 

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...