Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Omit character from a word 1

Status
Not open for further replies.

aarellano

MIS
Oct 22, 2007
168
US
Hi,

I came across a script that when you submit a form, it opens a pop up window where you can pass the value of any of the input fields.

Code:
<SCRIPT LANGUAGE="JavaScript">
function display() {
	DispWin = window.open('','onself','menubar=yes,status=yes,toolbar=yes,width=520,height=600')
	message = "<HTML><HEAD><center><TITLE>Davies Labor Scan </TITLE></center></HEAD><BODY>"
	message += "<br><p><center>Order Number '" + document.form1.ORD.value;
	message += "' .</p><p>"
	message += "<br><p><center>Macine Number    " + document.form1.LMACRN.value;
	message += "></p>"
	message += "<br><p><center>Part Number      " + document.form1.part.value;
	message += "</p>"
	message += "<p>Click on <b> File - Print</b> "
	message += "from your browser to print the page "
	message += "</p></BODY></HTML>"
	onLoad = window.close();
	
		
	DispWin.document.write(message);
	DispWin.document.close();
	
	
}
</SCRIPT>

The script works great the only problem that I have is that in the ORD field I have to enter a letter before the number
for example B123 is there a way to take the B out in the script?
 
If it's always 1 letter at the start, this change should work:

Code:
message += "<br><p><center>Order Number '" + document.form1.ORD.value[!].substr(1)[/!];

But really, this sort of thing should be done server-side, not client-side (so it works for those with JS disabled).

Hope this helps,
Dan



Coedit Limited - Delivering standards compliant, accessible web solutions

[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
BillyRayPreachersSon,
I really appreciate the help!!!!

thank you!!!!!

P.S.
by the way yesterday when I posted this I could not come up with "truncate" hence "omit"

oce again thank you!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top