Solved

Input field substitution

Posted on 2003-12-03
4
205 Views
Last Modified: 2010-04-06
Hi:

One of these days I got here this code below, which is working perfectly. But I realized that, when it adds the host "srv" to the entered domain name, it always show the complete server address in the Input Field. Is there a way of hiddening what it does? Thanks.

Mario./

Code:

<form>    
<input name="SERVER">
<input type=button value=Replace onClick="this.form.SERVER.value=this.form.SERVER.value.replace(/^(mail.|www.|srv.)*(\w+\.\w+)/i,'srv.$2')">
</form>
0
Comment
Question by:multisites
  • 3
4 Comments
 
LVL 4

Expert Comment

by:mikosha
ID: 9866925
Yuo can add one more hidden field to store updated value and js function for onClick event that will take thevalue from SERVER input ,update it , and stor ein this new hidden field.

cheers:)
0
 

Author Comment

by:multisites
ID: 9868535
Could you give me an example using this code I mentioned? Thanks a lot.
0
 
LVL 4

Accepted Solution

by:
mikosha earned 125 total points
ID: 9868572
Somthing like this, I think:

<form>    
<input name="SERVER">
<input name="SERVER_UPD" type='hidden'>
<input type=button value=Replace onClick="mybutton_click(this.form)">
</form>
<script language='javascript'>
function mybutton_click(current_form){
   current_form .SERVER_UPD.value = this.form.SERVER.value.replace(/^(mail.|www.|srv.)*(\w+\.\w+)/i,'srv.$2');
   return true
}
</script>
0
 
LVL 4

Expert Comment

by:mikosha
ID: 9883662
Thanx:)
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
How to dynamically load/unload User control in ASP.net page? 2 120
css help 3 92
Magento Indexing 1 69
Re-position the objects 7 50
There are two main kinds of selectors in CSS: One is base selector like h1, h2, body, table or any existing HTML tags.  For instance, the following rule sets all paragraphs (<p> elements) to red: (CODE) CSS also allows us to define our own custom …
Introduction Knockoutjs (Knockout) is a JavaScript framework (Model View ViewModel or MVVM framework).   The main ideology behind Knockout is to control from JavaScript how a page looks whilst creating an engaging user experience in the least …
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now