?
Solved

Trim Value/Field length before search

Posted on 2003-03-04
31
Medium Priority
?
4,508 Views
Last Modified: 2012-08-14
hi,

I' got this Database which is displayed by ASP. I have a search part, but i need to trim the values of the field.

eg values

srut-fe
tsf-fe
jifj-mprn
fjkdj-mprm
dsds-vpn
dsd-fddi

i need to trim/cut off the "-fe/-mprn/-vpn etc.

so basically i require to cut off the "-" and whats after it.

here my search part.

<form onSubmit="return EW_checkMyForm(this);"  action="data_validationlist.asp" method="get" name= "myform3">


<input type="hidden" name="z_Client" value="LIKE,'%,%'">&nbsp;</font></p>

<input type="hidden" name="x_Client" value="<%= x_Client %>" >&nbsp;

<A href='javascript:document.myform3.submit();'>
<IMG src = "images/data_validation_button2.jpg" border = "0" title = "Click here to view the Data Validation Certificate for this client"> </a>
</form>

----

x_Client is the value with the -fe/-mprn etc.

can any one help?

0
Comment
Question by:Robson8112
[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
  • 16
  • 13
  • +1
31 Comments
 
LVL 14

Expert Comment

by:avner
ID: 8064024
This method will remove the end part :

function TrimSpecial(str)
{
var re = /-fe|-mpm|-vpn/gi;
          return str.replace(re, "")
}



a running example :

<html>
<head>
<title>abot:blank</title>
<script language="javascript1.2">
<!-- avcoh@yahoo.com

function TrimSpecial(str)
{
var re = /-fe|-mpm|-vpn/gi;
          return str.replace(re, "")
}

var s = TrimSpecial("111-fe");
alert(s)
var s = TrimSpecial("222-mpm");
alert(s)
var s = TrimSpecial("333-vpn");
alert(s)

-->
</script>
<style>

</style>
</head>
<body>

</body>
</html>
0
 

Author Comment

by:Robson8112
ID: 8064200

I've tried it and it doesnt work

Do i not point it to x_clients, so it knows where to remove the -fe or -mprn etc ?
0
 
LVL 14

Expert Comment

by:avner
ID: 8064213
It works as you can see from the example, probably the implementation with the method is not working.

You will have to post the complete code so I can see where you went wrong.

0
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!

 

Author Comment

by:Robson8112
ID: 8064288
<% if Session("cwnaosat_status") <> "login" then response.redirect "login.asp" %>
<%
Response.expires = 0
Response.expiresabsolute = Now() - 1
Response.addHeader "pragma", "no-cache"
Response.addHeader "cache-control", "private"
Response.CacheControl = "no-cache"
%>
<!--#include file="db.asp"-->

<%
response.buffer = true

'get key
key = request.querystring("key")
if key="" or isnull(key) then
      key=request.form("key")
end if
if key="" or isnull(key) then response.redirect "clientslist.asp"

'get action
a=request.form("a")
if a="" or isnull(a) then
      a="I"      'display with input box
end if

' Open Connection to the database
set conn = Server.CreateObject("ADODB.Connection")
conn.Open xDb_Conn_Str

Select Case a
      Case "I": ' Get a record to display

            tkey = "'" & replace(replace(key & "","'","''"),"[","[[]") & "'"
            strsql = "SELECT * FROM [clients] WHERE [ID]=" & tkey

            set rs = Server.CreateObject("ADODB.Recordset")
            rs.Open strsql, conn
            If rs.EOF Then
                  Response.Clear
                  Response.Redirect "clientslist.asp"
            Else
                  rs.MoveFirst
            End If

            ' Get the field contents
            x_Client = rs("Client")
            x_Client_IP = rs("Client IP")
            x_Hardware = rs("Hardware")
            x_Media_Server = rs("Media Server")
            x_OS = rs("OS")
            x_Oracle_Backup = rs("Oracle Backup")
            x_OS_Backup = rs("OS Backup")
            x_Terminal_Emulation = rs("Terminal Emulation")
            x_Notes = rs("Notes")
            x_Known_Supportal = rs("Known Supportal")

            
            rs.Close
            Set rs = Nothing

End Select
%>


<p align="center"><u><b><font color="#000080" face="Arial" size="3">Clients View</font></b></u><font face="Arial" size="2"><br><br><a href="clientslist.asp">Back to List</a></font></p>


<p align="center">
<form>
<table border="0" cellspacing="1" cellpadding="5" bgcolor="#CCCCCC">

<tr>
<td bgcolor="#430066">
<p align="center"><font color="#CCFFFF"><font face="Arial" size="2">Client</font></font></p>
</td>
<td bgcolor="#F5F5F5">
<p align="center"><font face="Arial" size="2"><% response.write x_Client %></font>&nbsp;</p>
</td>
</tr>

<tr>
<td bgcolor="#330066">
<p align="center"><font color="#CCFFFF"><font face="Arial" size="2">IP</font></font></p>
</td>
<td bgcolor="#F5F5F5">
<p align="center"><font face="Arial" size="2"><% response.write x_IP %></font>&nbsp;</p>
</td>
</tr>

<tr>
<td bgcolor="#330066">
<p align="center"><font color="#FFFFFF"><font face="Arial" size="2">Master/Media Server </font>&nbsp;</font></p>
</td>
<td bgcolor="#F5F5F5">
<p align="center"><font face="Arial" size="2"><% response.write x_Media_Server %></font>&nbsp;</p>
</td>
</tr>

<tr>
<td bgcolor="#330066">
<p align="center"><font color="#FFFFFF"><font face="Arial" size="2">Hardware</font></font></p>
</td>
<td bgcolor="#F5F5F5">
<p align="center"><font face="Arial" size="2"><% response.write x_Hardware %></font>&nbsp;</p>
</td>
</tr>

<tr>
<td bgcolor="#330066">
<p align="center"><font color="#FFFFFF"><font face="Arial" size="2">OS</font></font></p>
</td>
<td bgcolor="#F5F5F5">
<p align="center"><font face="Arial" size="2"><% response.write x_OS %></font>&nbsp;</p>
</td>
</tr>

<tr>
<td bgcolor="#330066">
<p align="center"><font color="#FFFFFF"><font face="Arial" size="2">Terminal Emulation</font></font></p>
</td>
<td bgcolor="#F5F5F5">
<p align="center"><font face="Arial" size="2"><% response.write x_Terminal_Emulation %></font>&nbsp;</p>
</td>
</tr>



<tr>
<td bgcolor="#330066">
<p align="center"><font color="#FFFFFF"><font face="Arial" size="2">Oracle Backup </font></font></p>
</td>
<td bgcolor="#F5F5F5">
<p align="center"><font face="Arial" size="2"><% response.write x_Oracle_Backup %></font>&nbsp;</p>
</td>
</tr>

<tr>
<td bgcolor="#330066">
<p align="center"><font color="#FFFFFF"><font face="Arial" size="2">On Supportal </font></font></p>
</td>
<td bgcolor="#F5F5F5">
<p align="center"><font face="Arial" size="2"><% response.write x_Known_Supportal %></font>&nbsp;</p>
</td>
</tr>


<tr>
<td bgcolor="#330066">
  <p align="center"><font color="#FFFFFF"><font face="Arial" size="2">Notes</font>&nbsp;</font></p>
</td>
<td bgcolor="#F5F5F5">
  <p align="center"><font face="Arial" size="2"><% response.write x_Notes %></font>&nbsp;</p>
</td>
</tr>

</table>
</form>
<p>


<script language="JavaScript" src="ew.js"></script>
<p align="center">


<script language="JavaScript">
<!-- start Javascript
function  EW_checkMyForm(EW_this) {
return true;
}



// end JavaScript -->
</script>


</script>

<form onSubmit="return EW_checkMyForm(this);"  action="changeslist.asp" method="get" name = "myform">
<input type="hidden" name="z_Client" value="LIKE,'%,%'">&nbsp;
<p align="center">
<input type="hidden" name="x_Client" value="<%= x_Client %>" size=30 maxlength=60>&nbsp;
<A href='javascript:document.myform.submit();'><IMG src = "images/changes_associated_button.jpg" border = "0" title = "Click to view changes associated with this client"></a>

</form>


<form onSubmit="return EW_checkMyForm(this);"  action="problemslist.asp" method="get" name = "myform2">
<p align="center">
<input type="hidden" name="z_Client" value="LIKE,'%,%'">&nbsp;</font></p>
<p align="center">
<input type="hidden" name="x_Client" value="<%= x_Client %>" size=30 maxlength=60>&nbsp;
<A href='javascript:document.myform2.submit();'><IMG src = "images/problems_associated_button.jpg" border = "0" title = "Click here to view Problems associated with this client"> </a>


</form>

<form onSubmit="return EW_checkMyForm(this);"  action="data_validationlist.asp" method="get" name = "myform3">
<p align="center">
<input type="hidden" name="z_Client" value="LIKE,'%,%'">&nbsp;</font></p>
<p align="center">
<input type="hidden" name="x_Client" value="<%= x_Client %>" size=30 maxlength=60>&nbsp;

<A href='javascript:document.myform3.submit();'><IMG src = "images/data_validation_button2.jpg" border = "0" title = "Click here to view the Data Validation Certificate for this client"> </a>
</form>



<!--#include file="footer.asp"-->
<p>&nbsp;</p>





0
 

Author Comment

by:Robson8112
ID: 8064304
sorry i removed the code what u gave me!

if yours is right, please tell me where to put it!

Thanks
0
 
LVL 14

Expert Comment

by:avner
ID: 8064315
My code is a JavaScript code, that is client side, what you posted is the ASP page, that is server side. What I need is the output page (the HTML) generated by IIS.
0
 

Author Comment

by:Robson8112
ID: 8064362
hope this is what u need (HTML of the page)



<p align="center"><u><b><font color="#000080" face="Arial" size="3">Clients View</font></b></u><font face="Arial" size="2"><br><br><a href="clientslist.asp">Back to List</a></font></p>


<p align="center">
<form>
<table border="0" cellspacing="1" cellpadding="5" bgcolor="#CCCCCC">

<tr>
<td bgcolor="#430066">
<p align="center"><font color="#CCFFFF"><font face="Arial" size="2">Client</font></font></p>
</td>
<td bgcolor="#F5F5F5">
<p align="center"><font face="Arial" size="2">aspasea1-vpn</font>&nbsp;</p>
</td>
</tr>

<tr>
<td bgcolor="#330066">
<p align="center"><font color="#CCFFFF"><font face="Arial" size="2">IP</font></font></p>
</td>
<td bgcolor="#F5F5F5">
<p align="center"><font face="Arial" size="2"></font>&nbsp;</p>
</td>
</tr>

<tr>
<td bgcolor="#330066">
<p align="center"><font color="#FFFFFF"><font face="Arial" size="2">Master/Media Server </font>&nbsp;</font></p>
</td>
<td bgcolor="#F5F5F5">
<p align="center"><font face="Arial" size="2">Byadsm01</font>&nbsp;</p>
</td>
</tr>

<tr>
<td bgcolor="#330066">
<p align="center"><font color="#FFFFFF"><font face="Arial" size="2">Hardware</font></font></p>
</td>
<td bgcolor="#F5F5F5">
<p align="center"><font face="Arial" size="2">HP9000-800</font>&nbsp;</p>
</td>
</tr>

<tr>
<td bgcolor="#330066">
<p align="center"><font color="#FFFFFF"><font face="Arial" size="2">OS</font></font></p>
</td>
<td bgcolor="#F5F5F5">
<p align="center"><font face="Arial" size="2">HP-UX10.20</font>&nbsp;</p>
</td>
</tr>

<tr>
<td bgcolor="#330066">
<p align="center"><font color="#FFFFFF"><font face="Arial" size="2">Terminal Emulation</font></font></p>
</td>
<td bgcolor="#F5F5F5">
<p align="center"><font face="Arial" size="2"></font>&nbsp;</p>
</td>
</tr>



<tr>
<td bgcolor="#330066">
<p align="center"><font color="#FFFFFF"><font face="Arial" size="2">Oracle Backup </font></font></p>
</td>
<td bgcolor="#F5F5F5">
<p align="center"><font face="Arial" size="2"></font>&nbsp;</p>
</td>
</tr>

<tr>
<td bgcolor="#330066">
<p align="center"><font color="#FFFFFF"><font face="Arial" size="2">On Supportal </font></font></p>
</td>
<td bgcolor="#F5F5F5">
<p align="center"><font face="Arial" size="2">Yes</font>&nbsp;</p>
</td>
</tr>


<tr>
<td bgcolor="#330066">
  <p align="center"><font color="#FFFFFF"><font face="Arial" size="2">Notes</font>&nbsp;</font></p>
</td>
<td bgcolor="#F5F5F5">
  <p align="center"><font face="Arial" size="2"></font>&nbsp;</p>
</td>
</tr>

</table>
</form>
<p>


<script language="JavaScript" src="ew.js"></script>
<p align="center">


<script language="JavaScript">
<!-- start Javascript
function  EW_checkMyForm(EW_this) {
return true;
}



// end JavaScript -->
</script>


<script language="JavaScript">
function TrimSpecial(str)
{
var x_Client = /-fe|-mprn|-vpn/gi;
         return str.replace(x_Client, "")
}

</script>

<form onSubmit="return EW_checkMyForm(this);"  action="changeslist.asp" method="get" name = "myform">
<input type="hidden" name="z_Client" value="LIKE,'%,%'">&nbsp;
<p align="center">
<input type="hidden" name="x_Client" value="aspasea1-vpn" size=30 maxlength=60>&nbsp;
<A href='javascript:document.myform.submit();'><IMG src = "images/changes_associated_button.jpg" border = "0" title = "Click to view changes associated with this client"></a>

</form>


<form onSubmit="return EW_checkMyForm(this);"  action="problemslist.asp" method="get" name = "myform2">
<p align="center">
<input type="hidden" name="z_Client" value="LIKE,'%,%'">&nbsp;</font></p>
<p align="center">
<input type="hidden" name="x_Client" value="aspasea1-vpn" size=30 maxlength=60>&nbsp;
<A href='javascript:document.myform2.submit();'><IMG src = "images/problems_associated_button.jpg" border = "0" title = "Click here to view Problems associated with this client"> </a>


</form>

<form onSubmit="return EW_checkMyForm(this);"  action="data_validationlist.asp" method="get" name = "myform3">
<p align="center">
<input type="hidden" name="z_Client" value="LIKE,'%,%'">&nbsp;</font></p>
<p align="center">
<input type="hidden" name="x_Client" value="aspasea1-vpn" size=30 maxlength=60>&nbsp;

<A href='javascript:document.myform3.submit();'><IMG src = "images/data_validation_button2.jpg" border = "0" title = "Click here to view the Data Validation Certificate for this client"> </a>
</form>



 


<p>&nbsp;</p>






0
 
LVL 14

Expert Comment

by:avner
ID: 8064381
Ok, You added the method but you have not used it.

When exactly do you want this trimmed string to be send to , how and when ?

0
 

Author Comment

by:Robson8112
ID: 8064398
i would like it to be trimmed before, the search, not at the top, beacause im displaying the full name of the client.


<form onSubmit="return EW_checkMyForm(this);"  action="changeslist.asp" method="get" name = "myform">
<input type="hidden" name="z_Client" value="LIKE,'%,%'">&nbsp;
<p align="center">
<input type="hidden" name="x_Client" value="aspasea1-vpn" size=30 maxlength=60>&nbsp;
<A href='javascript:document.myform.submit();'><IMG src = "images/changes_associated_button.jpg" border = "0" title = "Click to view changes associated with this client"></a>

</form>
0
 

Author Comment

by:Robson8112
ID: 8064422
as u can see here:

<input type="hidden" name="x_Client" value="aspasea1-vpn" size=30 maxlength=60>&nbsp

aspasea1-vpn is one of the clients i clicked to view, so its that value i want the -vpn removing from before i submit.
0
 
LVL 14

Expert Comment

by:avner
ID: 8064455
The thing is this , the HTML is a complete mess.

This is the fixed HTML , but you will have to fix the ASP according to this HTML. every  open TAG should be closed, the hidden INPUT fileds should be a direct childrens of the form element :

<p align="center"><u><b><font color="#000080" face="Arial" size="3">Clients View</font></b></u><font face="Arial" size="2"><br><br><a href="clientslist.asp">Back to List</a></font></p>


<p align="center">
<form>
<table border="0" cellspacing="1" cellpadding="5" bgcolor="#CCCCCC">

<tr>
<td bgcolor="#430066">
<p align="center"><font color="#CCFFFF"><font face="Arial" size="2">Client</font></font></p>
</td>
<td bgcolor="#F5F5F5">
<p align="center"><font face="Arial" size="2">aspasea1-vpn</font>&nbsp;</p>
</td>
</tr>

<tr>
<td bgcolor="#330066">
<p align="center"><font color="#CCFFFF"><font face="Arial" size="2">IP</font></font></p>
</td>
<td bgcolor="#F5F5F5">
<p align="center"><font face="Arial" size="2"></font>&nbsp;</p>
</td>
</tr>

<tr>
<td bgcolor="#330066">
<p align="center"><font color="#FFFFFF"><font face="Arial" size="2">Master/Media Server </font>&nbsp;</font></p>
</td>
<td bgcolor="#F5F5F5">
<p align="center"><font face="Arial" size="2">Byadsm01</font>&nbsp;</p>
</td>
</tr>

<tr>
<td bgcolor="#330066">
<p align="center"><font color="#FFFFFF"><font face="Arial" size="2">Hardware</font></font></p>
</td>
<td bgcolor="#F5F5F5">
<p align="center"><font face="Arial" size="2">HP9000-800</font>&nbsp;</p>
</td>
</tr>

<tr>
<td bgcolor="#330066">
<p align="center"><font color="#FFFFFF"><font face="Arial" size="2">OS</font></font></p>
</td>
<td bgcolor="#F5F5F5">
<p align="center"><font face="Arial" size="2">HP-UX10.20</font>&nbsp;</p>
</td>
</tr>

<tr>
<td bgcolor="#330066">
<p align="center"><font color="#FFFFFF"><font face="Arial" size="2">Terminal Emulation</font></font></p>
</td>
<td bgcolor="#F5F5F5">
<p align="center"><font face="Arial" size="2"></font>&nbsp;</p>
</td>
</tr>



<tr>
<td bgcolor="#330066">
<p align="center"><font color="#FFFFFF"><font face="Arial" size="2">Oracle Backup </font></font></p>
</td>
<td bgcolor="#F5F5F5">
<p align="center"><font face="Arial" size="2"></font>&nbsp;</p>
</td>
</tr>

<tr>
<td bgcolor="#330066">
<p align="center"><font color="#FFFFFF"><font face="Arial" size="2">On Supportal </font></font></p>
</td>
<td bgcolor="#F5F5F5">
<p align="center"><font face="Arial" size="2">Yes</font>&nbsp;</p>
</td>
</tr>


<tr>
<td bgcolor="#330066">
 <p align="center"><font color="#FFFFFF"><font face="Arial" size="2">Notes</font>&nbsp;</font></p>
</td>
<td bgcolor="#F5F5F5">
 <p align="center"><font face="Arial" size="2"></font>&nbsp;</p>
</td>
</tr>

</table>
</form>
<p>


<script language="JavaScript" src="ew.js"></script>
<p align="center">


<script language="JavaScript">
<!-- start Javascript
function  submitForm(sForm) {
var oForm = document.forms[sForm]
var  re = /-fe|-mprn|-vpn/gi;
oForm.children["x_Client"].value =  oForm.children["x_Client"].value.replace(re, "")
oForm.submit();
}

// end JavaScript -->
</script>

<form action="changeslist.asp" method="get" name = "myform">
      <input type="hidden" name="z_Client" value="LIKE,'%,%'">
      <input type="hidden" name="x_Client" value="aspasea1-vpn" size=30 maxlength=60>
      <p align="center">

      <A href='javascript:submitForm("myform")'><IMG src = "images/changes_associated_button.jpg" border = "0" title = "Click to view changes associated with this client"></a>

</form>


<form action="problemslist.asp" method="get" name = "myform2">
<input type="hidden" name="z_Client" value="LIKE,'%,%'">
<input type="hidden" name="x_Client" value="aspasea1-vpn" size=30 maxlength=60>
<p align="center">

<A href='javascript:submitForm("myForm2")'><IMG src = "images/problems_associated_button.jpg" border = "0" title = "Click here to view Problems associated with this client"> </a>


</form>

<form action="data_validationlist.asp" method="get" name = "myform3">
<input type="hidden" name="z_Client" value="LIKE,'%,%'">
<input type="hidden" name="x_Client" value="aspasea1-vpn" size=30 maxlength=60>&nbsp;
<p align="center">


<A href='javascript:submitForm("myform3")'><IMG src = "images/data_validation_button2.jpg" border = "0" title = "Click here to view the Data Validation Certificate for this client"> </a>
</form>






<p>&nbsp;</p>
0
 

Author Comment

by:Robson8112
ID: 8064544
which tags am i missing?  I've put the script in but is still doesnt remove the -fe etc

<script language="JavaScript">
<!-- start Javascript
function  submitForm(sForm) {
var oForm = document.forms[sForm]
var  re = /-fe|-mprn|-vpn/gi;
oForm.children["x_Client"].value =  oForm.children["x_Client"].value.replace(re, "")
oForm.submit();
}

// end JavaScript -->
</script>

<form onSubmit="return EW_checkMyForm(this);"  action="changeslist.asp" method="get" name = "myform">
<input type="hidden" name="z_Client" value="LIKE,'%,%'">&nbsp;
<p align="center">
<input type="hidden" name="x_Client" value="dyespp1-fe" size=30 maxlength=60>&nbsp;
<A href='javascript:document.myform.submit();'><IMG src = "images/changes_associated_button.jpg" border = "0" title = "Click to view changes associated with this client"></a>

</form>
0
 
LVL 1

Expert Comment

by:mbochniak
ID: 8065438
Try running the value of the field through this before submitting:

function GetPrefix(strValue){
if (!strValue.test(/(\w+)[-]\w+/g)) return strValue;
var bMatch = strValue.match(/(\w+)[-]\w+/);
return bMatch[1];
}

If the function finds a match to the pattern "(some characters) - (some characters)" it will return the characters before the "-", otherwise it will return the full full passed value.

Good Luck!

Mike
0
 
LVL 4

Expert Comment

by:jonnal
ID: 8067671
hi
str= str.split('-')[0];
0
 
LVL 14

Accepted Solution

by:
avner earned 100 total points
ID: 8069901
Here is the fixed code.
<script language="JavaScript">
<!-- start Javascript
function  submitForm(sForm) {
var oForm = document.forms[sForm]
var  re = /-fe|-mprn|-vpn/gi;
oForm.children["x_Client"].value =  oForm.children["x_Client"].value.replace(re, "")
oForm.submit();
}

// end JavaScript -->
</script>

<form onSubmit="return EW_checkMyForm(this);"  action="changeslist.asp" method="get" name = "myform">
<input type="hidden" name="x_Client" value="dyespp1-fe" size=30 maxlength=60>&nbsp;
<input type="hidden" name="z_Client" value="LIKE,'%,%'">&nbsp;
<p align="center">

<A href='javascript:submitForm("myform");'><IMG src = "images/changes_associated_button.jpg" border = "0" title = "Click to view changes associated with this client"></a>

</form>

1. The hidden input must be a direct child of the FORM element.
2. Notice the <A href="javascript.... "/>   , I'm using a method to submit the form, this method cleans the value of x_Client.
0
 

Author Comment

by:Robson8112
ID: 8070405
If the value of x_Client is going to be cleaned, then doesnt that mean a "blank" value will be passed?
0
 
LVL 14

Expert Comment

by:avner
ID: 8070496
What do you mean by :"If the value of x_Client is going to be cleaned"
Why do you think it is being cleaned ?
0
 

Author Comment

by:Robson8112
ID: 8070631
From what you noted at the bottom of your last comment

"I'm using a method to submit the form, this method cleans the value of x_Client"
0
 
LVL 14

Expert Comment

by:avner
ID: 8070639
When I wrote "cleans" I meant "parsing" , sorry if I wasn't clear enough.
0
 

Author Comment

by:Robson8112
ID: 8070650
oh sorry, mis understood you,

I've tried the code, but still no joy!

im not sure i understand "direct child of the FORM element"
0
 
LVL 14

Expert Comment

by:avner
ID: 8070707
>direct child of the FORM element

<FORM>
<INPUT type="HIDDEN"></INPUT>
</FORM>


That is FORM and the direct child INPUT

and not :
<FORM>
<p>
<INPUT type="HIDDEN"></INPUT>
</p>
</FORM>

in this case the INPUT is a child of the "p" element.

What is the problem now ? (post the HTML output, i will look into it.)

0
 

Author Comment

by:Robson8112
ID: 8070839
<p align="center"><u><b><font color="#000080" face="Arial" size="3">Clients View</font></b></u><font face="Arial" size="2"><br><br><a href="clientslist.asp">Back to List</a></font></p>


<p align="center">
<form>
<table border="0" cellspacing="1" cellpadding="5" bgcolor="#CCCCCC">

<tr>
<td bgcolor="#430066">
<p align="center"><font color="#CCFFFF"><font face="Arial" size="2">Client</font></font></p>
</td>
<td bgcolor="#F5F5F5">
<p align="center"><font face="Arial" size="2">dyespp1-fe</font>&nbsp;</p>
</td>
</tr>

<tr>
<td bgcolor="#330066">
<p align="center"><font color="#CCFFFF"><font face="Arial" size="2">IP</font></font></p>
</td>
<td bgcolor="#F5F5F5">
<p align="center"><font face="Arial" size="2"></font>&nbsp;</p>
</td>
</tr>

<tr>
<td bgcolor="#330066">
<p align="center"><font color="#FFFFFF"><font face="Arial" size="2">Master/Media Server </font>&nbsp;</font></p>
</td>
<td bgcolor="#F5F5F5">
<p align="center"><font face="Arial" size="2">Dyadsm01</font>&nbsp;</p>
</td>
</tr>

<tr>
<td bgcolor="#330066">
<p align="center"><font color="#FFFFFF"><font face="Arial" size="2">Hardware</font></font></p>
</td>
<td bgcolor="#F5F5F5">
<p align="center"><font face="Arial" size="2">HP9000-800</font>&nbsp;</p>
</td>
</tr>

<tr>
<td bgcolor="#330066">
<p align="center"><font color="#FFFFFF"><font face="Arial" size="2">OS</font></font></p>
</td>
<td bgcolor="#F5F5F5">
<p align="center"><font face="Arial" size="2">HP-UX11.00</font>&nbsp;</p>
</td>
</tr>

<tr>
<td bgcolor="#330066">
<p align="center"><font color="#FFFFFF"><font face="Arial" size="2">Terminal Emulation</font></font></p>
</td>
<td bgcolor="#F5F5F5">
<p align="center"><font face="Arial" size="2"></font>&nbsp;</p>
</td>
</tr>



<tr>
<td bgcolor="#330066">
<p align="center"><font color="#FFFFFF"><font face="Arial" size="2">Oracle Backup </font></font></p>
</td>
<td bgcolor="#F5F5F5">
<p align="center"><font face="Arial" size="2"></font>&nbsp;</p>
</td>
</tr>

<tr>
<td bgcolor="#330066">
<p align="center"><font color="#FFFFFF"><font face="Arial" size="2">On Supportal </font></font></p>
</td>
<td bgcolor="#F5F5F5">
<p align="center"><font face="Arial" size="2"></font>&nbsp;</p>
</td>
</tr>


<tr>
<td bgcolor="#330066">
  <p align="center"><font color="#FFFFFF"><font face="Arial" size="2">Notes</font>&nbsp;</font></p>
</td>
<td bgcolor="#F5F5F5">
  <p align="center"><font face="Arial" size="2"></font>&nbsp;</p>
</td>
</tr>

</table>
</form>
<p>


<script language="JavaScript" src="ew.js"></script>
<p align="center">


<script language="JavaScript">
<!-- start Javascript
function  EW_checkMyForm(EW_this) {
return true;
}
// end JavaScript -->
</script>






<script language="JavaScript" src="ew.js"></script>
<p align="center">


<script language="JavaScript">
<!-- start Javascript
function  submitForm(sForm) {
var oForm = document.forms[sForm]
var  re = /-fe|-mprn|-vpn/gi;
oForm.children["x_Client"].value =  oForm.children["x_Client"].value.replace(re, "")
oForm.submit();
}

// end JavaScript -->
</script>


<form onSubmit="return EW_checkMyForm(this);"  action="changeslist.asp" method="get" name = "myform">
<p align="center">
<input type="hidden" name="z_Client" value="LIKE,'%,%'">&nbsp;
<input type="hidden" name="x_Client" value="dyespp1-fe" size=30 maxlength=60>&nbsp;
<A href='javascript:document.myform.submit();'><IMG src = "images/changes_associated_button.jpg" border = "0" title = "Click to view changes associated with this client"></a>
</form>


<form onSubmit="return EW_checkMyForm(this);"  action="problemslist.asp" method="get" name = "myform2">
<p align="center">
<input type="hidden" name="z_Client" value="LIKE,'%,%'">&nbsp;</font></p>
<p align="center">
<input type="hidden" name="x_Client" value="dyespp1-fe" size=30 maxlength=60>&nbsp;
<A href='javascript:document.myform2.submit();'><IMG src = "images/problems_associated_button.jpg" border = "0" title = "Click here to view Problems associated with this client"> </a>


</form>

<form onSubmit="return EW_checkMyForm(this);"  action="data_validationlist.asp" method="get" name = "myform3">
<p align="center">
<input type="hidden" name="z_Client" value="LIKE,'%,%'">&nbsp;</font></p>
<p align="center">
<input type="hidden" name="x_Client" value="dyespp1-fe" size=30 maxlength=60>&nbsp;

<A href='javascript:document.myform3.submit();'><IMG src = "images/data_validation_button2.jpg" border = "0" title = "Click here to view the Data Validation Certificate for this client"> </a>
</form>
0
 
LVL 14

Expert Comment

by:avner
ID: 8070860
You have still not updated the HTML to output correctly.
Look at the HTML I posted before you need to change all the elements so that the ouput will be exactly as my input.
For example :

1. All onSubmit="return EW_checkMyForm(this);"   should be removed.
2. <input type="hidden" name="x_Client" value="dyespp1-fe" size=30 maxlength=60> should eb right under the <form> tag.
3. <A href='javascript:document.myform3.submit();'>< should be changed to <A href='javascript:submitForm('myform')'> where 'myform' is the current form name as appears in the FORM tag.
0
 

Author Comment

by:Robson8112
ID: 8071015
ok, its now failing. is the <A href='javascript:submitForm('myform3')' correct??


<script language="JavaScript">
<!-- start Javascript
function  submitForm(sForm) {
var oForm = document.forms[sForm]
var  re = /-fe|-mprn|-vpn/gi;
oForm.children["x_Client"].value =  oForm.children["x_Client"].value.replace(re, "")
oForm.submit();
}

// end JavaScript -->
</script>


<form action="changeslist.asp" method="get" name = "myform">
<input type="hidden" name="x_Client" value="<%= x_Client %>" size=30 maxlength=60>&nbsp;
<p align="center">
<input type="hidden" name="z_Client" value="LIKE,'%,%'">&nbsp;
<A href='javascript:submitForm('myform3')'><IMG src = "images/changes_associated_button.jpg" border = "0" title = "Click to view changes associated with this client"></a>

</p>
</form>
0
 
LVL 14

Expert Comment

by:avner
ID: 8071197
NO.
Look at the "name" attribute of the "form" tag :
<form action="changeslist.asp" method="get" name = "myform">

the name is "myform" so the href should be :
<A href='javascript:submitForm('myform')'
0
 

Author Comment

by:Robson8112
ID: 8071227
i know, i realised thats after i posted my code up and changed it after,

However, it still fails
0
 

Author Comment

by:Robson8112
ID: 8071233
there something wrong with

<A href='javascript:submitForm('myform')'>
0
 
LVL 14

Expert Comment

by:avner
ID: 8071245
I have runned this code on my machine and is working fine, try to post the full code and I'll tell you where is the problem.

0
 

Author Comment

by:Robson8112
ID: 8071330



<p align="center"><u><b><font color="#000080" face="Arial" size="3">Clients View</font></b></u><font face="Arial" size="2"><br><br><a href="clientslist.asp">Back to List</a></font></p>


<p align="center">
<form>
<table border="0" cellspacing="1" cellpadding="5" bgcolor="#CCCCCC">

<tr>
<td bgcolor="#430066">
<p align="center"><font color="#CCFFFF"><font face="Arial" size="2">Client</font></font></p>
</td>
<td bgcolor="#F5F5F5">
<p align="center"><font face="Arial" size="2">dyemw09-fe</font>&nbsp;</p>
</td>
</tr>

<tr>
<td bgcolor="#330066">
<p align="center"><font color="#CCFFFF"><font face="Arial" size="2">IP</font></font></p>
</td>
<td bgcolor="#F5F5F5">
<p align="center"><font face="Arial" size="2"></font>&nbsp;</p>
</td>
</tr>

<tr>
<td bgcolor="#330066">
<p align="center"><font color="#FFFFFF"><font face="Arial" size="2">Master/Media Server </font>&nbsp;</font></p>
</td>
<td bgcolor="#F5F5F5">
<p align="center"><font face="Arial" size="2">Dyadsm01</font>&nbsp;</p>
</td>
</tr>

<tr>
<td bgcolor="#330066">
<p align="center"><font color="#FFFFFF"><font face="Arial" size="2">Hardware</font></font></p>
</td>
<td bgcolor="#F5F5F5">
<p align="center"><font face="Arial" size="2">Solaris</font>&nbsp;</p>
</td>
</tr>

<tr>
<td bgcolor="#330066">
<p align="center"><font color="#FFFFFF"><font face="Arial" size="2">OS</font></font></p>
</td>
<td bgcolor="#F5F5F5">
<p align="center"><font face="Arial" size="2">Solaris8</font>&nbsp;</p>
</td>
</tr>

<tr>
<td bgcolor="#330066">
<p align="center"><font color="#FFFFFF"><font face="Arial" size="2">Terminal Emulation</font></font></p>
</td>
<td bgcolor="#F5F5F5">
<p align="center"><font face="Arial" size="2"></font>&nbsp;</p>
</td>
</tr>



<tr>
<td bgcolor="#330066">
<p align="center"><font color="#FFFFFF"><font face="Arial" size="2">Oracle Backup </font></font></p>
</td>
<td bgcolor="#F5F5F5">
<p align="center"><font face="Arial" size="2"></font>&nbsp;</p>
</td>
</tr>

<tr>
<td bgcolor="#330066">
<p align="center"><font color="#FFFFFF"><font face="Arial" size="2">On Supportal </font></font></p>
</td>
<td bgcolor="#F5F5F5">
<p align="center"><font face="Arial" size="2"></font>&nbsp;</p>
</td>
</tr>


<tr>
<td bgcolor="#330066">
  <p align="center"><font color="#FFFFFF"><font face="Arial" size="2">Notes</font>&nbsp;</font></p>
</td>
<td bgcolor="#F5F5F5">
  <p align="center"><font face="Arial" size="2"></font>&nbsp;</p>
</td>
</tr>

</table>
</form>
<p>


<script language="JavaScript" src="ew.js"></script>
<p align="center">









<script language="JavaScript" src="ew.js"></script>
<p align="center">


<script language="JavaScript">
<!-- start Javascript
function  submitForm(sForm) {
var oForm = document.forms[sForm]
var  re = /-fe|-mprn|-vpn/gi;
oForm.children["x_Client"].value =  oForm.children["x_Client"].value.replace(re, "")
oForm.submit();
}

// end JavaScript -->
</script>


<form  action="changeslist.asp" method="get" name = "myform">
<input type="hidden" name="x_Client" value="dyemw09-fe" size=30 maxlength=60>&nbsp;
<p align="center">
<input type="hidden" name="z_Client" value="LIKE,'%,%'">&nbsp;
<A href='javascript:submitForm('myform')'><IMG src = "images/changes_associated_button.jpg" border = "0" title = "Click to view changes associated with this client"></a>

</p>
</form>
0
 
LVL 14

Expert Comment

by:avner
ID: 8071359
Your problem is now qoutes, ' can not be inside ' so :

<A href='javascript:submitForm('myform')'>
should actually be :
<A href='javascript:submitForm("myform")'>

0
 

Author Comment

by:Robson8112
ID: 8071377
Woooo hooo..  at last!

Thanks you very much, and thanks again for your patience!

25 points in your bag!
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

This article will give core knowledge of JavaScript and will head in to your first JavaScript program. I am Durvesh Naik and I am here to deal with this series of JavaScript. I will teach you JavaScript in part wise , as its quite boring to read big…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. 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.: (CODE)
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…
Suggested Courses

765 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