Solved

Input field substitution

Posted on 2003-12-03
4
207 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: Matthew
I am a very big proponent of technology compliance standards and strive to meet such criteria in all of my work. That includes my site, which is 100% XHTML 1.0 compliant as determined by the World Wide Web Consortium. https://www.matthewstevenkel…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

930 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

11 Experts available now in Live!

Get 1:1 Help Now