473,809 Members | 2,710 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Simple Remove text from attribute value

This is a snippet from my page:

<form name="form1" method="post" action="Default .aspx?id=365272 "
id="form1" enctype="multip art/form-data">

I need some javascript that can check if the id query string is in the
action attribute, and if it is, remove it so the form element will look
like this:

<form name="form1" method="post" action="Default .aspx" id="form1"
enctype="multip art/form-data">

Thanks.

Oct 6 '06 #1
2 3326
Lee
eg****@gmail.co m said:
>
This is a snippet from my page:

<form name="form1" method="post" action="Default .aspx?id=365272 "
id="form1" enctype="multip art/form-data">

I need some javascript that can check if the id query string is in the
action attribute, and if it is, remove it so the form element will look
like this:

<form name="form1" method="post" action="Default .aspx" id="form1"
enctype="multi part/form-data">
No, what you want is to replace the action attribute value with
the current value with anything after and including a "?" removed.

off the top of my head, that's
document.form1. action=document .form1.action.r eplace(/\?.*/,"");
--

Oct 6 '06 #2
Thanks,

I'm doing this and it works:

document.form1. action='default .aspx';
Lee wrote:
eg****@gmail.co m said:

This is a snippet from my page:

<form name="form1" method="post" action="Default .aspx?id=365272 "
id="form1" enctype="multip art/form-data">

I need some javascript that can check if the id query string is in the
action attribute, and if it is, remove it so the form element will look
like this:

<form name="form1" method="post" action="Default .aspx" id="form1"
enctype="multip art/form-data">

No, what you want is to replace the action attribute value with
the current value with anything after and including a "?" removed.

off the top of my head, that's
document.form1. action=document .form1.action.r eplace(/\?.*/,"");
--
Oct 6 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
2661
by: scorpion | last post by:
I have a simple type like this: <xs:simpleType name="SizeType"> <xs:restriction base="xs:token"> <xs:enumeration value="small"/> <xs:enumeration value="medium"/> <xs:enumeration value="large"/> <xs:enumeration value="xlarge"/> </xs:restriction> </xs:simpleType>
2
7972
by: Claudio Jolowicz | last post by:
How can XSLT stylesheets be used to edit, remove and add nodes specified by their position in the document tree? The XML document stores development tasks in a hierarchical way, i.e. tasks can have subtasks, subsubtasks, etc. It has the following form: <todo> <note>Task 1</note> <note> Task 2
14
6425
by: Brandon | last post by:
I am an amateur working on a first site, I have settled on using FP 2002 for now. My current page is up and live, but I have two errors that I cant seem to get rid of ... Line 29, column 6: duplicate specification of attribute "STYLE" style="border: 1px solid #00F;width: 750px; height: 690px;" Line 154, column 46: there is no attribute "BORDERCOLOR" <table border="0" cellspacing="0" bordercolor="#0000FF" width="650"
3
1651
by: Marc Llenas | last post by:
Hi there, I'm stuck on a validation function for a form and I cannot figure out what the problem is. The page is in ASP. Any ideas? The function being called is: <script language="JavaScript" type="text/javascript"> function checkform ( form ) {
11
2547
by: greg.scharlemann | last post by:
I've been playing with this form validation method for a while and have tried an array of things but haven't had any luck with a couple items. 1. The validateForm() function doesn't detect when the Min price is greater than the maximum price. 2. The validateForm() function doesn't call isNumber() on the minBaths, maxBaths, minBeds, or maxBeds. 3. Despite errors in input and the validateForm() function returning false, the form is still...
8
4262
by: rdavis7408 | last post by:
I am attempting what I would think would be a simple calculation of the cost of traveling a single mile. But I can not figure this out. The following is my script. Any help would be appreciated. I want the user to enter the price per gallon in one textbox, the miles per gallon in the next textbox and then press the button and get the cost per gallon by dividing the price per gallon by the miles per gallon.
7
1663
by: db | last post by:
Hi@all Just got a comparison problem with javascript. I want to compare : document.getElementById(currentID).getAttribute("style") with a string, e.g: "background-color: lightgreen;" They are exactly the same, but the execution result seems they are not equal. It works with firefox, but not with IE.
3
1247
by: P2000 | last post by:
I want to make a regex for the replace function that will replace any "a" with "A" and any "b" with "B". This is what I did so far... (I'm trying to learn this RegEx thing) <form> <input name="source" onkeyup="target.value=s.value.replace(/a/g, 'A')"/><br /> <input name="target" /> </form>
4
1757
by: N9 | last post by:
Hi I had a xslt that parse a XML document, output is HTML But XSLT adding not valid code: <ul class="level_1" xmlns="" xmlns:xsi="http://www.w3.org/2001/ XMLSchema-instance"> I had try to adding the text below to stylesheet but it does't help.
0
9603
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10640
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10376
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10387
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9200
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7662
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6881
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5689
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3861
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.