Solved

Input field substitution

Posted on 2003-12-03
4
211 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Shoutout to Emily Plummer (http://www.experts-exchange.com/members/eplummer26.html) for giving me this article! She did most of it, I just finished it up and posted it for her :)    Introduction In a previous article (http://www.experts-exchang…
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 the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

696 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