Set value in HTML input hidden field

0
0

Good morning,

i’ve an HtmlPanel embedded in a window.

The code of the htmlpanel is this:

<form action=”http://app.xxx.it/call/default.aspx” method=”POST”>
<div>
<label for=”Name”>Nome</label>
<input name=”Name” id=”Name” type=”hidden” value=”” runat=”server”>
<div>
<label for=”Lastname”>Cognome</label>
<input name=”Lastname” id=”Lastname” type=”hidden” value=”” runat=”server”>
</div>
<div>
<button class=”button-8″> SEND</button>
</div>
</form>

I Would like to assign the value of each input field automatically during load event.

Is there a way to di this?

  • You must to post comments
0
0

Hi Angelos,

You can definitely do that!

Each Control or Widget has an InitScript property that you can customize to your liking, with that being said, it can be used to have some custom functions that you can Call them from the server.

Wisej can call JavaScript functions or run any JavaScript scripts , using the Call and Eval methods respectively.

This can be scoped to the entire application (by using Application.Call() or Application.Eval()) or on individual controls (i.e Control.Call() or Control.Eval()).

For more information on this, you can visit:
https://docs.wisej.com/api/wisej.web/general/application#call-function-args
https://docs.wisej.com/api/wisej.web/general/application#eval-script
https://docs.wisej.com/api/wisej.web/content/widget#initscript

I have updated the provided sample and I re-attached it!

HTH,
Alaa

Attachment
  • Angelo Bordonaro
    Hi Alaa, thank you i’ve understood and i’ve replicated your indications.and it works. However what i would like to do, by calling the javascript function, is to replicate the POST action of the html form we ‘ve built by customizing the html propertry of the htmlpanel as you described before.. Unofrtunately, i’m really sorry, i’m not familiar with javascript….
  • Angelo Bordonaro
    SOLVED.! iin the initscript of the HTMLPanel i’v replaced button.onClick = function(){ alert(“Button is clicked”); } with button.onClick = function(){ document.getElementById(‘frm’).submit(); } Now it’s working! Thank you for the support.
  • You must to post comments
0
0

Alaa i’m sorry,

now i would like to “click” programmatically the HTML button without really push it, for example on an event.

Is it possible?

  • You must to post comments
0
0

HI Alaa,

thank you very much.

SOLVED!

  • You must to post comments
0
0

Hi Angelo,

I have attached a sample that might be of help to you.

Basically, you can assign any placeholder id in your HTML code and then replace it with whatever value you want.

The HtmlPanel has the Html property that you can manipulate, no matter the source.

Please visit : HtmlPanel – Documentation for more info.

HTH,
Alaa

Attachment
  • You must to post comments
Showing 4 results
Your Answer

Please first to submit.