Solved

Input field substitution

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

Industry Leaders: 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

Suggested Solutions

Title # Comments Views Activity
Forbidden errors 5 156
replace quotes with UTF-8 character 38 112
Problem to ToolkitScriptManager 2 78
MS Access VBA How To Properly Set Up A multipart/related HTTP Request 13 73
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 …
I found this questions asking how to do this in many different forums, so I will describe here how to implement a solution using PHP and AJAX. The logical flow for the problem should be: Write an event handler for the first drop down box to get …
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
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 …

730 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