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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Regex needed 1

Status
Not open for further replies.

iggitme

IS-IT--Management
Sep 13, 2006
47
US
Asking for help here... have this

var z=document.getElementById("item_description").value;
parent.desc.location.href = 'index.cgi?z=sd&w=saveDESC&item_description=' + z;

need to have a regex in there to permit non alphanumeric characters to pass without becoming something else..

example: sending a % throug this winds up being a 0 instead
and other characters such as + are ignored, while characters like @ and & result in an error sent to the perl script doing the actual work after it receives from this script

so.... is there a very simple regex to allow non alphanumeric characters to pass through this script , escaped or not, so what is typed into the text field, actually winds up being what gets saved from that text field

thank you for your help
 
Its not a javascript or a regex answer, but why not just call index.cgi with POST variables?

-----------------------------------------
I cannot be bought. Find leasing information at
 
I have no choice in how its done. It is a javascript submission done in onblur in conjunction with another submission done with another method... characters are not passing through the javascript intact... % becomes 0 others kill the transaction with the perl script ...

OK nevermind... thanks for the input... i'll figure this out the hard way.
 
iggitme (IS/IT--Management) said:
I have no choice in how its done. It is a javascript submission done in onblur in conjunction with another submission done with another method... characters are not passing through the javascript intact... % becomes 0 others kill the transaction with the perl script ...

OK nevermind... thanks for the input... i'll figure this out the hard way.

wow!

--------
GOOGLE is a great resource to find answers to questions like "how do i..."

If you don't know exaclty what you want to do or what to search on, try Google Suggest: --------
I have recently been semi-converted to ensuring all my code (well most of it) works in both javascript and non-javasc
 
ggriffit: Exactly. I was heading toward a regex to add an escape to non alphanumeric characters. But encoding the data makes perfect sense to me. A simple thing.

Thank you for a brilliant solution.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top